[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: What is a Compound Document?

  • To: "'Roger L. Costello'" <costello@m...>, 'XML Developers List' <xml-dev@l...>
  • Subject: RE: What is a Compound Document?
  • From: "Bullard, Claude L (Len)" <len.bullard@i...>
  • Date: Fri, 28 Jan 2005 10:11:58 -0600

what is a compound document
You have multiple senses for that term and they 
overlap in browser/rendering applications.

In one sense in which the term was originally used, 
it is a document with multiple semantics.  The problem 
is 'semantics by intension' or by 'extension'.  In 
other words, by class or by collection.

The fact of schema validation doesn't affect that 
definition.  XML Has No Meaning.

So do you want the syntactical/structural fact of 
compounding or the class/collection semantic fact of 
compounding.  A browser has to do both so the validation 
of the syntactic/structural compound has value or you 
get into dynamic loading on parse issues.

SGML DTDs with NOTATION declarations acted as much as 
reference architecture contracts as they ever did as 
runtime specifications for instance conformance.

len


From: Roger L. Costello [mailto:costello@m...]

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 &amp; 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 &amp; 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.