[xsd-users] Arbitrary XML inside XML element

Boris Kolpackov boris at codesynthesis.com
Wed Aug 6 16:48:44 EDT 2008


Hi Attila,

Attila <atteeela at gmail.com> writes:

> If I use the <any> method (as described here:
> http://www.xfront.com/ExtensibleContentModels.html#method2), can I retrieve
> the arbitrary XML as a string for an element?
> How does CS handle this situation?

XSD actually goes one step further and allows you to access XML 
fragments matched by wildcards (any and anyAttribute) as DOM nodes.
You can even use these DOM nodes to create an object model if the
content in your wildcards is described by a schema.

For more information on all this see Section 2.12, "Mapping for any
and anyAttribute" in the C++/Tree Mapping User Manual:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/manual/#2.12

As well as the 'wildcard' example in examples/cxx/tree/.

If, for some reason, you would prefer to have the XML fragment as a 
string instead of DOM, then you can use the Xerces-C++ functionality
to serialize the returned DOM node to a string.

Boris




More information about the xsd-users mailing list