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

Discussion in 'XML' started by Tony Prichard, Dec 12, 2003.

  1. 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
    Tony Prichard, Dec 12, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. loveNUNO
    Replies:
    2
    Views:
    910
    loveNUNO
    Nov 20, 2003
  2. Laurens
    Replies:
    2
    Views:
    1,069
    Laurens
    Jan 9, 2004
  3. Clive
    Replies:
    1
    Views:
    374
    Peter Flynn
    Aug 21, 2005
  4. Replies:
    4
    Views:
    676
  5. Johan
    Replies:
    20
    Views:
    1,602
    Arndt Jonasson
    Feb 27, 2007
Loading...

Share This Page