Oxygen XML Editor
 
[XML-DEV Mailing List Archive Home] [By Thread] [By Date]

RE: [xml-dev] Embed an XML document in another XML document


  • To: Jean-Noël Colin <jean-noel.colin@...>, <xml-dev@...>
  • Subject: RE: [xml-dev] Embed an XML document in another XML document
  • From: "Chiusano Joseph" <chiusano_joseph@...>
  • Date: Wed, 29 Dec 2004 14:36:14 -0500
  • Thread-index: AcTtkN7L2OsgqPwhTieDi7eMnewcIAATI8qw
  • Thread-topic: [xml-dev] Embed an XML document in another XML document

Or you could forego creating a schema and use the newly ratified W3C Xinclude 1.0 Recommendation for this: http://www.w3.org/TR/xinclude/

Kind Regards,
Joseph Chiusano
Booz Allen Hamilton
Strategy and Technology Consultants to the World
 

> -----Original Message-----
> From: Jean-Noël Colin [mailto:jean-noel.colin@...] 
> Sent: Wednesday, December 29, 2004 5:23 AM
> To: xml-dev@...
> Subject: [xml-dev] Embed an XML document in another XML document
> 
> Hi
> 
> I would like to create a XML Schema that would define the 
> structure of an XML document that contains XML document
> 
> Typically, something like
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <message ... >
>     <messageid>123456</messageid>
>     <body>
>     <?xml version="1.0" encoding="UTF-8"?> <filter ... >
>     <and>
>     <comp><op>eq</op><field>1.3</field><value>value1</value></comp>
>     <comp><op>eq</op><field>1.2</field><value>value2</value></comp>
>     </and>
> </filter>    
>     </body>
> </message>
> 
> I tried defining the schema like this, using different 
> definitions for the body element, but I can't validate it.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://voyager.oxys.be/xml/ns/MyTest-0_1"
>     xmlns="http://voyager.oxys.be/xml/ns/MyTest-0_1"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>     <xs:element name="message" type="MessageType"/>
>     <xs:complexType name="MessageType">
>         <xs:sequence>
>             <xs:element type="xs:NMTOKEN" name="messageid"/>
>             <xs:element type="xs:anyType" name="body"/>
>         </xs:sequence>
>     </xs:complexType>
> </xs:schema>
> 
> 
> The reason I need this is because I have to define a 
> structure of a message that is able any type of body. So I 
> can't define the type of the body (using a choice, for instance).
> 
> Any suggestion welcome,
> 
> Happy New Year
> 
> Jean-Noel Colin
> 
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org 
> <http://www.xml.org>, an initiative of OASIS 
> <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 
> 

 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor
Keywords