wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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?
 
Similar Threads
settings ?
Question 11 of HFSJ Final mocktest
JNDI Port number issue while strating JBoss server 4.2.2.GA
WebSphere Portal 348 - prime questions/answers
How to display the 3rd index record of a collection in a new table detail