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 IDREF AND IDREFS. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "IDREF AND IDREFS." Watch "IDREF AND IDREFS." New topic
Author

IDREF AND IDREFS.

Vasudha Deepak
Ranch Hand

Joined: Mar 15, 2002
Posts: 86
Hi,
The concept of using IDREF is not clear.I understand that using IDREFS enables us to have multiple unique values for an ID type attribute,but what exaclty is the purpose of an IDREF?
Thanks,
Vasudha


IBM Certified Developer -XML and Related Technologies(141)<br />SCJP2 SCWCD
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Consider a authorization store.
You will typically have n users and they need to be assigned to specific roles.
So you might want to declare role elements having attributes of type ID.
Then you might associate users with the role using an attribute of type IDREF.
<Role name="ADMIN" roleid="role_admin"/>
<Role name="USER" roleid="role_user"/>
<User name="Guido" assocrole="role_admin"/>
<User name="Rossum" assocrole="role_user"/>
and in the dtd
<!ATTLIST Role roleid ID>
<!ATTLIST User assocrole IDREF>
If a user can have multiple roles then assocrole must be of the type IDREFS
<User name="Rossum" assocrole="role_user role_admin"/>
Vasudha Deepak
Ranch Hand

Joined: Mar 15, 2002
Posts: 86
Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IDREF AND IDREFS.