It's not a secret anymore!
The moose likes XML and Related Technologies and the fly likes DTD creation 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 "DTD creation" Watch "DTD creation" New topic

DTD creation

Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
is it possible to implement the following idea in dtd creation

ie a ELEMENT x can contain either another element a or a String(#PCDATA)

I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
Yes, it is called "mixed content" and will look like
<!ELEMENT x (#PCDATA | a)* >
(not sure the first declaration is correct. I fished it out of some book, and this book is currently under my suspicion Can somebody verify, is the first declaration correct or not?)
But it is not excluding "or", the model above allows both PCDATA and "a" elements to be presented in an XML document in any sequence and any number.
If you need excluding "or",i.e. "either PCDATA or "a" element, but not both", then I am not sure DTD can specify this. If I am wrong, somebody will correct me.
[This message has been edited by Mapraputa Is (edited June 15, 2001).]

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
It is sorta covered in the JavaRanch Style Guide.
subject: DTD creation
It's not a secret anymore!