Use of 'xsd:ID' and 'xsd:IDREF'
Implementing more constrained XML types xsd:ID
and xsd:IDREF
instead of xsd:string
in railML:tGenericID
and railML:tGenericRef
.
-
That allows only one attribute of type
xsd:ID
in each element. railML schemas definerailML:id
attribute for this purpose, inherited byrailML:tElementWithIDAndName
. -
That requires unique
railML:id
attributes for whole XML file. -
That restricts
railML:id
attribute to pass theNCName
rules: no Whitespaces, starting with a letter or "_", see also [http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName] -
That requires
railML:id
with XML Attributerequired
orimplied
(nodefault
possible). -
That requires non-zero-length attributes of type
xsd:IDREF
. railML schemas define attributerailML:refID
, inherited byrailML:tElementWithReference
orrailML:*RefId
attributes for this reason. -
That requires
xsd:IDREF
attributes, that match anxsd:ID
attribute value inside an XML file.
See also [http://www.w3.org/TR/2000/WD-xml-2e-20000814#NT-TokenizedType]
This type change results in stronger identifier and reference rules. XML validators are supposed to obey these rules and identify non-conforming XML files.