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

Re: Proposed process for DTDs in XML (Implementations)

  • From: Paul Prescod <papresco@t...>
  • To: xml-dev@i...
  • Date: Mon, 25 May 1998 10:38:27 -0400

dtds for dom tree
Ron Bourret wrote:
> 
> Trees vs. Events
> ----------------
> It seems like we need to decide early on whether we are interested in getting
> the DTD as events or a tree.  

I think that we are defining a language, not an API. Since the language
will use XML instance syntax, whether you get access to it as a tree or
events will depend entirely on whether your processor uses SAX or the DOM
(or something else altogether).

> Notice that the definitions of a and b are at the same level.  That is, when I
> build a DOM tree from this XML, a and b are siblings, not parent and child.
> When exploring a DTD, the parent-child relationship is far nicer -- I move up
> and down the DOM tree and get the metadata I need at each level.  On the other
> hand, such a tree complicates the DTD (sorry ;) for XSchema/XTD/etc. and I'm not
> sure if representing children with multiple parents would even be possible,
> given the strict nesting requirements of XML.  Comments?

Your last instinct is correct. A DTD is not a tree, but a directed acyclic
graph. There is no way to define any but the most trivial DTD as a tree:

<!ELEMENT Paragraph (#PCDATA|Emph)>
<!ELEMENT Title (#PCDATA|Emph)>
<!ELEMENT Emph (#PCDATA)>

Emph is used twice, so this simple (and typical) DTD is not a tree and
cannot be represented using XML element nesting.

 Paul Prescod  - http://itrc.uwaterloo.ca/~papresco

"You have the wrong number."
"Eh? Isn't that the Odeon?"
"No, this is the Great Theater of Life. Admission is free, but the 
taxation is mortal. You come when you can, and leave when you must. The 
show is continuous. Good-night." -- Robertson Davies, "The Cunning Man"

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.