Home › Forums › General XMetaL Discussion › Topic ID Error in XMetaL 6.0.2.070 › Reply To: Topic ID Error in XMetaL 6.0.2.070
Reply to: Topic ID Error in XMetaL 6.0.2.070
July 15, 2011 at 7:45 pmOur XML validator was missing a validation check for a few versions for attributes declared as type “ID”. The current behaviour in 6.0.2.070 is correct and follows the XML Recommendation.
This issue would have affected very few people working with DITA documents because of the additional code we have in place (only for DITA) that automatically sets an @id for topics (and the values we set follow the recommendation). However, as you state, if you did manually set a value for @id the product was essentially letting you set any value, including illegal values.
Detailed Information
XMetaL Author uses the standard DITA 1.1 DTDs that include the following declaration in topic.mod (this is duplicated for the other topic types):
id ID #REQUIRED
conref CDATA #IMPLIED
%select-atts;
%localization-atts;
outputclass
CDATA #IMPLIED
%arch-atts;
domains CDATA "&included-domains;">
The portion highlighted in blue is most relevant to this discussion.
The XML Recommendation states that the value for this type of attribute (ID) must be unique in the current document, and that the value must match the “NAME production” (which is defined elsewhere in the recommendation). Part of those rules include restrictions for the first character (NameStartChar*) which specifically do not include the characters 0-9.
See: http://www.w3.org/TR/xml/#id
* The full list as defined in the recommendation is as follows:
NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]