Help on including one XML document within another XML document using XML Schemas

T

Tony Prichard

Hi

I would like to specify an XML schema that would allow an XML document
to be included within another XML document. The following example
schema gives an idea of what we're trying to achieve

ServiceResponse.xsd
--------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="serviceResponse" type="ServiceResponse"/>
<xs:complexType name="ServiceResponse">
<xs:sequence>
<xs:element name="anXMLDocument" type="xs:string"/>
<xs:element name="someOtherData" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>



The element anXMLDocument would contain an XML data string that would
be parsed against a different XML Schema. The identity of the XML
Schema for parsing anXMLDocument is not known at the time the
ServiceResponse XML is parsed.

Previously when we used DTDs we used inline CDATA wrappers around the
contained XML document to avoid it being parsed. Can we still continue
to use inline CDATA wrappers around the XML data when we parse against
XML schemas? I've tried looking into the XML Schema specs but the
mention of CDATA seems a bit sparse and doesn't seem to answer the
question.

If we can't use an inline CDATA wrapper is there an alternative way of
achieving the same effect?

Many thanks

Tony Prichard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top