[xsd-users] Turn on xinclude with Xerces-3.0.0 and XSD 3.2.0?

Boris Kolpackov boris at codesynthesis.com
Tue Dec 2 04:59:47 EST 2008


Hi Scott,

Scott White <sww314 at gmail.com> writes:

> Is there a way to turn on XInclude in the generated code from XSD?
> In Xerces, you set a parameter (fgXercesDoXInclude). I did not see any
> documentation for a similiar flag on the XSD side.

There is no such flag in XSD. Generally, we follow the rule of
only duplicating the most commonly used Xerces-C++ features and
properties in the XSD interface. For the less frequently used
ones, such as fgXercesDoXInclude, you will need to set up the
XML-to-DOM parsing yourself. This is not difficult to do. Just
take a look at the multiroot example in examples/cxx/tree/. It
includes the code for parsing XML-to-DOM (dom-parser.*) which
you can re-use in your application with some minor adjustments
(e.g., add fgXercesDoXInclude).

Also note that XInclude does not play very well with XML Schema 
validation. If validation is enabled, it will be performed on
the document before XInclude's are processed. This means that
your schema will need to explicitly define all the places in
your vocabulary where inclusion can be performed. Furthermore,
the included fragments are not validated since they may not be
complete enough to be valid.

Boris




More information about the xsd-users mailing list