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?
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With