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 ID and IDREF attributes in XML 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 "ID and IDREF attributes in XML" Watch "ID and IDREF attributes in XML" New topic
Author

ID and IDREF attributes in XML

chaitanya sai
Greenhorn

Joined: May 25, 2006
Posts: 2
Hi all,
can we create two ID attributes in for one element tag in XML DTD?
that is..... for example:


<!ELEMENT BOOK(#PCDATA)>
<!ATTLIST BOOK BOOK_ID ID #REQUIRED>
<!ATTLIST BOOK AUTH_ID ID #REQUIRED>

if so..,
then i am using IDREF for another new attribute for EMP element.
then to which ID ..this IDREF refers...

for Ex:

<!ATTLIST BOOK REF_BOOK IDREF #IMPLIED>

...
i want to whether it is possible to create two ID attributes for one element. if possible ..how this above code will work.
its urgent..
plz let me know ..

looking forward for clear and quick response.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

No element can have more than one ID. An ID is an identifier for that element. It doesn't make any sense to have more than one identifier for the same thing.

(BTW: you should probably read this and this before posting again)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ID and IDREF attributes in XML
 
Similar Threads
DOM leaf nodes
DTD - IDREF
ID/IDREF association in DTD
XML for Assignment Log
Using IDREFs with XML Schema