[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: What is a Compound Document?
I don't think schema validation has much to do with the notion of compound documents. Compound documents are about combining elements from multiple vocabularies yet preserving the semantics from each vocabulary in a way that allows one to fit together the parts to make a coherrent whole. The classic example is embedding MathML in XHTML. Whether xs:any is used to specify extension points or not is'nt the tricky bit or even the interesting bit about compound documents. -- PITHY WORDS OF WISDOM The buddy system is essential to your survival; it gives the enemy somebody else to shoot at. -----Original Message----- From: Roger L. Costello [mailto:costello@m...] Sent: Friday, January 28, 2005 7:59 AM To: 'XML Developers List' Subject: What is a Compound Document? Hi Folks, I am still unclear on what a compound document is. 1. What is a compound document? A compound document is an XML document comprised of elements from independently developed schemas. For example, an XML document that is comprised of elements from the SVG schema and elements from the XHTML schema is a compound document. 2. How is this different from an instance document that conforms to an XML Schema that uses the <any/> element ? Suppose that my Book schema uses an <any/> element after the declaration for Title: targetNamespace="http://www.books.org" <element name="Book"> <complexType> <sequence> <element name="Title" type="string"/> <any namespace="##other"/> <element name="Author" type="string"/> <element name="Date" type="string"/> <element name="ISBN" type="string"/> <element name="Publisher" type="string"/> </sequence> </complexType> </element> This declaration of Book states that "After the Title element you can have any element from any other namespace". So, an XML document could thus contain elements from the book namespace and the XHTML namespace: <Book xmlns="http://www.books.org"> <Title>The First and Last Freedom</Title> <HTML xmlns="http://www.w3.org/TR/REC-xhtml"> <BODY>Hello World</BODY> </HTML> <Author>J. Krishnamurti</Author> <Date>1954</Date> <ISBN>0-06-064831-7</ISBN> <Publisher>Harper & Row</Publisher> </Book> Is this a compound document? It meets the above definition, i.e., the instance document is comprised of elements from independently developed schemas and namespaces. I am guessing that it is not a compound document. True? I am guessing that a compound document entails more than simply an instance document comprised of elements from multiple vocabularies. I am guessing that if the Book schema were declared without the <any/> element, e.g., targetNamespace="http://www.books.org" <element name="Book"> <complexType> <sequence> <element name="Title" type="string"/> <element name="Author" type="string"/> <element name="Date" type="string"/> <element name="ISBN" type="string"/> <element name="Publisher" type="string"/> </sequence> </complexType> </element> And an instance document inserted an XHTML element after the Title element: <Book xmlns="http://www.books.org"> <Title>The First and Last Freedom</Title> <HTML xmlns="http://www.w3.org/TR/REC-xhtml"> <BODY>Hello World</BODY> </HTML> <Author>J. Krishnamurti</Author> <Date>1954</Date> <ISBN>0-06-064831-7</ISBN> <Publisher>Harper & Row</Publisher> </Book> Then this instance document is a compound document. Is this true? If so, then by definition a compound document cannot be validated by an XML Schema validator. Correct? For example, an XML Schema validator would reject the above instance document, saying "invalid element after Title, expecting Author". So, what is a compound document? /Roger ----------------------------------------------------------------- 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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|