Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to write a DTD for this scenario?

 
Ajay Xavier
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic