• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

modeling recursive data in XML with DTD

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A friend of mine is trying to represent some recursive data in XML. Basically, a chapter can have some data as well as any number of sub-chapters, which in turn can have sub-sub-chapters, etc. Since the number of levels is not fixed, we don't want to use fixed elements like <chapter>, <subchapter>, etc. Ideally, the XML would look something like this:

Do you know if it is possible to represent this kind of recursive data in a DTD? Apparently the parser complained about the DTD that my friend used to constrain this XML document even though it looked fine.
I know there are alternative, possibly better ways to represent this data. I am just curious whether this is possible or not.
-Mirko
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See if this link helps:
http://www.cs.colorado.edu/~gerry/xml/dtds.html
 
Mirko Froehlich
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, this looks just like the thing I was looking for!
-Mirko

Originally posted by Jim Baiter:
See if this link helps:
http://www.cs.colorado.edu/~gerry/xml/dtds.html


 
Your mother was a hamster and your father was a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic