[xsd-users] Arbitrary XML inside XML element
Attila
atteeela at gmail.com
Wed Aug 6 17:32:51 EDT 2008
Thanks for the information. One more thing: Can I use the C++/Parser to do
the same thing?
I would like to be able to get the sub-XML text for specific nodes, but not
receive callbacks for the "any'ed" elements that happen to show up. Would
there be anyway to perform a test to see if there are "any" elements
underneath a specific element that you just received a callback for?
Background:
We have a pseudo XML-RPC spec, and one of the <value> tags needs to contain
arbitrary XML, but it may not always be the case. I was thinking about
revamping this pseudo XML-RPC spec to be more like SOAP
(envelope/header/body) with the validation/binding done by XSD C++/Parser
(as we are currently using Xerces/SAX).
Thanks,
On Wed, Aug 6, 2008 at 4:48 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:
> 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
>
--
Attila
Software Developer
atteeela at gmail.com
More information about the xsd-users
mailing list