Reputation: 523
Can anyone provide brief example on how the built in types : IDREF/IDREFS and ENTITY/ENTITIES) being used in schemas? What are their primary purposes?
Cheers
Upvotes: 1
Views: 180
Reputation: 163272
These types were added to XML Schema because the working group wanted to provide a transition route from DTDs that replicated all the functionality available in DTDs; so the primary intent was backwards compatibility.
IDREF and IDREFS don't really do anything that you can't achieve with key/keyref, except that they are always scoped to the XML document level, whereas key/keyref are always scoped to an element.
ENTITY/ENTITES is connected with the rarely used feature of unparsed external entities. Basically it allows you to constrain the value of an attribute (or element) to be the name of an external parsed entity - which, oddly, can only be declared in the DTD. If you're not using this feature today, then you don't need to know what it does, you can safely ignore it.
Upvotes: 3