File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes how to write a DTD for this scenario? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to write a DTD for this scenario?" Watch "how to write a DTD for this scenario?" New topic
Author

how to write a DTD for this scenario?

Ajay Xavier
Ranch Hand

Joined: Jan 03, 2005
Posts: 109
hi,

consider the following xml

<set after = "A">
<item name="A" ></item>
<item name="B" ></item>
</set>

The DTD for the "item" element is

<!ATTLIST item name (A | B| C| D| E ) #REQUIRED >

The attribute "after" of "set" can hold a single valid name like
<set after = "A">
or
a collection of valid names seperated by coma like <set after = "A,B,C">

how to write DTD for the "after" attibute such that it will contain a single valid name or collection of names?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

There is not really a way to do that with a DTD. You can make the attribute-type a list of possible values (as you ahve done) but the values would have to also include the CVS lists of possible values, which isn't very good.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to write a DTD for this scenario?