File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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

ID and IDREF attributes in XML

chaitanya sai

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:


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

for Ex:


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

looking forward for clear and quick response.
Paul Sturrock

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
It is sorta covered in the JavaRanch Style Guide.
subject: ID and IDREF attributes in XML
It's not a secret anymore!