Reply to: Ditamap Editor – "Update All References"March 19, 2010 at 11:15 pm
Thanks Severin. Your suggestion sounds like something we should consider.
First, to try to clarify the question of whether the OT throws errors when the @type attribute on a map doesn't match the topic type: The OT gives a “warning” message in the log file, but it generates output that looks fine and works, and I believe most users wouldn't even notice the warning message because XMetaL doesn't notify you unless there are actual problems. If you do bring up the log file, you see a warning message like this:
[code][xslt] file:/C:/DOCUME%7e1/syeo/APPLIC%7e1/SoftQuad/XMETAL%7e1/DITA_OT/xsl/common/output-message.xsl:68:20: Warning! [DOTX019W][WARN]: The type attribute on a topicref element does not match the target topic. The type attribute was set to 'pizza', but the topicref points to a more specific 'concept' topic. This may cause your links to sort incorrectly in the output. Note that the type attribute is inherited in maps, so the value 'pizza' may come from an ancestor topicref. Check and make the type of topicref match with the actual type of topic.The location of this problem was at (File = c:documents and settingssyeomy documentsxmetalsamplesditaSample_Map.ditamap, Element = topicref:1)[/code]
As most people wouldn't even notice the warning, I don't think the fact that the warnings are generated is a good reason by itself to change how XMetaL populates the @type attribute on topicrefs.
There are a couple of reasons I can think of to not automatically populate the @type attribute with values corresponding to specialized topic types:
– Sometimes people create specialized topic types just because they want to add a new structural rule or use fewer element types. In these cases it is is appropriate to process a specialized topic exactly the same way that you would process an unspecialized topic. Using a different @type value would provide no benefit in these cases and would be one more thing that could go wrong in processing.
– It is conceivable that some processing tools could be hardcoded to allow only certain values for @type.
It would be good for us to get a sense of how many people *would* want to do specialized processing based on specialized @type attribute values in topicrefs, so we can balance that need against the above risks. Please reply here if this is something that you need.