RE: Element With Same Name
Hello Raja, One option you have with DTDs is to use a mixed content model, such as: <!ELEMENT item (#PCDATA|Note)*> <!ELEMENT Note (whatever)> <!ELEMENT whatever EMPTY> which would allow instances such as 1. <item>hello</item> 2. <item> <Note><whatever/></Note> <Note><whatever/></Note> </item> 3. <item>hello<Note><whatever/></Note></item> Another option is to use RELAX NG  which has more expressive power than DTDs: <element name="item" xmlns="http://relaxng.org/ns/structure/1.0"> <choice> <text/> <zeroOrMore> <element name="Note"> <element name="whatever"><empty/></element> </element> </zeroOrMore> </choice> </element> where instances 1 and 2 are valid but 3 is not. Mike  http://www.oasis-open.org/committees/relax-ng/ -----Original Message----- From: rajac [mailto:rajac@n...] Sent: Saturday, March 16, 2002 10:44 AM To: xml-dev@l... Subject: Element With Same Name Hi, I have an Element in DTD called item ie <!ELEMENT item (#PCDATA)>. But same Element item(in the same DTD) should be used like <!ELEMENT item (Note*)>. This Note is an another Element which has a structure. So the Element item is used in two different structures in same DTD. I tried to use <!ELEMENT item (ANY)>. But it is not working. I hope that i have explained the problem clearly. If the problem is not clear, please ask me. Regards, Raja
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format