Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between IDREF and IDREFS in XSD?

Tags:

xml

xsd

What is the difference between IDREF and IDREFS in XSD?
I know they both reference the ID attribute, but what is the difference? When each one of them is used?

like image 665
user990635 Avatar asked Jul 13 '12 08:07

user990635


1 Answers

An attribute of type IDREF is a reference to some other element with an attribute of type ID.

An attribute of type IDREFS is a list of references to elements with ID attributes, separate by spaces.

An example:

You're creating a family tree. Each person has 2 parents, a mother and a father. This would be denoted by IDREFS like so:

<person person_id="e10001" parent_id="e10002 e10003">

with

  <!ATTLIST person
person_id ID #REQUIRED
parent_id IDREFS #IMPLIED>
like image 59
PoeHaH Avatar answered Oct 22 '22 14:10

PoeHaH