Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic