Re: [xml] load() and includes


On Thu, 2005-07-07 at 12:02 -0500, Trevor Lowing wrote:
Question: If I load() an XML schema as an XML document that contains xs:includes, are the includes also 
loaded into the DOM? In not, as appears to be the case from my attempts, is there any way of doing this? 
Some XInclude trick perhaps?  

<xs:include>s are processed at the XS processor level, in terms of loading
those documents to be able to create the XML Schema components, which these
documents represent. I.e. an <xs:include> is not meant to include a node tree
like XInclude does. An example: chameleon <xs:include>s, where there's no
targetNamespace in the <xs:include>d schema, need to be adjusted to
the targetNamespace of the including schema.
A simplified solution could be: search for <xs:include> in the node
tree, fetch the schema document it points to manually, and add this tree
Note that such an include at the tree level could change the
semantics of your schema - probably even break it, since, as mentioned
above, an <xs:include> is different from including a node tree.
Another problem is be that circular <xs:include>s are allowed at the
XS level, so I wonder what you could do in such a case.



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