[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Proposed process for DTDs in XML (Implementations)
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! 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
|