[xml] Regarding Schema Chameleon include



Hi,

I had a doubt regarding the chameleon include mechanism in libxml. In the code for a chameleon include, the check is as follows in the function xmlSchemaAddSchemaDoc:-

} else {

       /* <include> and <redefine> */

       if (bkt != NULL) {

 

           if ((bkt->origTargetNamespace == NULL) &&

              (bkt->targetNamespace != sourceTargetNamespace)) {

              xmlSchemaBucketPtr chamel;

 

My query is when will this part of the code be hit. The checks make it impossible to hit this piece of code.

Say for instance we have a schema file A with targetnamespace which includes another Schema file B with targetnamespace NULL, in this case bkt->origTargetNamespace will be NULL, and bkt->targetNamespace == sourceTargetNamespace always since after including a schema, included items

will get the namespace of the source.

 

In other instance if targetnamespaces of A & B are different then libxml raises an error. So I am not sure in what scenario this will be hit. I would be grateful if someone could tell me whether such a case exists.

 

Thanks!!

 

Regards

Ashwin

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]