General XMetaL Discussion
[email protected] July 15, 2011 at 3:46 pm
Topic ID Error in XMetaL 6.0.2.070July 15, 2011 at 3:46 pmParticipants 2Replies 3Last Activity 11 years, 6 months ago
Prior to version 6.0.2.070, I was able to start a topic-level ID with a digit without issue. Now in 6.0.2.070, when I add/edit a topic ID with a leading digit, an error displays stating “”1″ is not allowed in a name. Name must start with a letter followed by letters, digits, “.”, “_”, “-“, “:”, combining chars or extenders. Error occured in attribute id. Continue? Yes/No” If I select Yes, I can leave the ID with the leading digit, and the file validates successfully. And if I open existing files with topic IDs that start with digits, no warning/message appears.
If the leading digit doesn't invalidate the file, is there a way to turn off this message?
RPDerek Read July 15, 2011 at 7:45 pm
Reply to: Topic ID Error in XMetaL 6.0.2.070July 15, 2011 at 7:45 pm
Our 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.
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
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.
* 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][email protected] July 15, 2011 at 8:07 pm
Reply to: Topic ID Error in XMetaL 6.0.2.070July 15, 2011 at 8:07 pm
But if 6.0.2.070 is now correctly checking the ID attribute, why is it just an informational message that I can bypass and the file still validates? Shouldn't the validation test now fail if I go ahead and accept the leading digit?
We have ID conventions in place that don't follow the UUIDs XMetaL builds.
RPDerek Read July 15, 2011 at 8:58 pm
Reply to: Topic ID Error in XMetaL 6.0.2.070July 15, 2011 at 8:58 pm
The Attribute Inspector does not forbid any values from being entered but it does warn about validation problems. If you enter an illegal value a dialog that contains descriptive messages for the particular issue is displayed and it gives you the option to continue with or to back out of making the change.
When you save a document a full validation is performed. At that point you should see an error in the Validation Log. A warning dialog that you will be saving an invalid document should also appear prior to saving. This dialog asks if you would like to proceed.
It is possible to customize the product to absolutely forbid these types of things but as we cannot predict what the work flow is for any particular individual or company we lean toward flexibility with an out-of-the-box installation.
Also note that if your ID convention differs from the UUID that XMetaL inserts that can be customized through a supported API so that the product automatically inserts your format. This is discussed to some degree here: http://forums.xmetal.com/index.php/topic,1260.0.html Or you may wish to discuss implementing such a solution (if that is beyond your skill set) with our Professional Services team.
- You must be logged in to reply to this topic.