What is the difference between IDREF and IDREFS in XSD?

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

+6
source share
1 answer

An IDREF type attribute is a reference to some other element with a type identifier attribute.

An attribute of type IDREFS is a list of links to elements with identifier attributes, separated by spaces.

Example:

You create a family tree. Each person has 2 parents, a mother and a father. This is indicated by IDREFS as follows:

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

from

  <!ATTLIST person person_id ID #REQUIRED parent_id IDREFS #IMPLIED> 
+13
source

Source: https://habr.com/ru/post/920396/


All Articles