Automatically add @type when a topicref is added to a DITA map

Hi group When I add a topicref to a DITA map, I see that the @type attribute is left unspecified. It would be nice if the @type attribute would then automatically be filled in, depending on the information type of the topic. For example, when I add a topicref to a task topic, the @type attribute would automatically be type="task". Is this possible or is this a new feature request? Thanks -- Yves Barbion www.scripto.nu

Hello Yves, I consider that it's more flexible not to add the @type value when a topic ref is inserted. In this way, if the type of the referenced topic changes (it was a task and then you change it to be a concept) then you do not need to remember to also update the <topicref>. What is your usecase? Do you have a CMS which requires the @type to be added? The DITA 1.2 specs is very vague:
When a referencing element is first added to or updated in a document, DITA aware editors may, but are not required to, set the type attribute value based on the actual type of a referenced DITA topic.
Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/16/2012 1:07 PM, Yves Barbion wrote:
Hi group
When I add a topicref to a DITA map, I see that the @type attribute is left unspecified. It would be nice if the @type attribute would then automatically be filled in, depending on the information type of the topic. For example, when I add a topicref to a task topic, the @type attribute would automatically be type="task".
Is this possible or is this a new feature request?
Thanks
-- Yves Barbion www.scripto.nu <http://www.scripto.nu>
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Radu I agree that, if the topic type changes, you don't have to remember to update @type on the topicref. However, I don't think that topic types changes that often, also because it's kinda hard to change topic types afterwards, because you also have to change the child elements, for example conbody and refbody. In my experience, it's easier to create a new topic and then just copy/paste the content into the <body> (or conbody, taskbody, refbody) of that topic. My use case: I'm not using a CMS. I add topics to my ditamap in various ways. The easiest one is to just create my topics first and then select the files in Windows Explorer and drag them into my ditamap. I then have to remember to add type="concept" because the DITA Open Toolkit also uses this information for the "generated labels" for related topics (using reltable). For example, if you have related tasks and you have specified type="task", the generated label will read "Related tasks", which is good, because this helps the reader to navigate to the correct type of topic. If you didn't specify the @type attribute, the generated label will read "Related information", which is too vague for me. Maybe we can cross-post this conversation to the dita-users group and see what other people think? Kind regards Yves On Thu, Aug 16, 2012 at 2:02 PM, Oxygen XML Editor Support < support@oxygenxml.com> wrote:
Hello Yves,
I consider that it's more flexible not to add the @type value when a topic ref is inserted. In this way, if the type of the referenced topic changes (it was a task and then you change it to be a concept) then you do not need to remember to also update the <topicref>. What is your usecase? Do you have a CMS which requires the @type to be added?
The DITA 1.2 specs is very vague:
When a referencing element is first added to or updated in a document, DITA aware editors may, but are not required to, set the type attribute value based on the actual type of a referenced DITA topic.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 8/16/2012 1:07 PM, Yves Barbion wrote:
Hi group
When I add a topicref to a DITA map, I see that the @type attribute is left unspecified. It would be nice if the @type attribute would then automatically be filled in, depending on the information type of the topic. For example, when I add a topicref to a task topic, the @type attribute would automatically be type="task".
Is this possible or is this a new feature request?
Thanks
-- Yves Barbion www.scripto.nu <http://www.scripto.nu>
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- Yves Barbion www.scripto.nu

Hi Yves, Some comments:
I then have to remember to add type="concept" because the DITA Open Toolkit also uses this information for the "generated labels" for related topics (using reltable). For example, if you have related tasks and you have specified type="task", the generated label will read "Related tasks", which is good, because this helps the reader to navigate to the correct type of topic. If you didn't specify the @type attribute, the generated label will read "Related information", which is too vague for me.
Maybe this happens for you because the reltable has the header defined as:
<relheader> <relcolspec type="topic"/> <relcolspec type="topic"/> </relheader>
but if you avoid setting the @type on the header like:
<relheader> <relcolspec/> <relcolspec/> </relheader>
it seemed to me (in the samples I tried) that the DITA OT detected the type of the topic from the actual content.
Maybe we can cross-post this conversation to the dita-users group and see what other people think?
That's a good idea, if you also want to post this on the dita-users list you can also link to our users list in order for people to see the already existing discussion:
http://www.oxygenxml.com/pipermail/oxygen-user/2012-August/004339.html
Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/16/2012 3:23 PM, Yves Barbion wrote:
Hi Radu
I agree that, if the topic type changes, you don't have to remember to update @type on the topicref. However, I don't think that topic types changes that often, also because it's kinda hard to change topic types afterwards, because you also have to change the child elements, for example conbody and refbody. In my experience, it's easier to create a new topic and then just copy/paste the content into the <body> (or conbody, taskbody, refbody) of that topic.
My use case:
I'm not using a CMS. I add topics to my ditamap in various ways. The easiest one is to just create my topics first and then select the files in Windows Explorer and drag them into my ditamap. I then have to remember to add type="concept" because the DITA Open Toolkit also uses this information for the "generated labels" for related topics (using reltable). For example, if you have related tasks and you have specified type="task", the generated label will read "Related tasks", which is good, because this helps the reader to navigate to the correct type of topic. If you didn't specify the @type attribute, the generated label will read "Related information", which is too vague for me.
Maybe we can cross-post this conversation to the dita-users group and see what other people think?
Kind regards
Yves
On Thu, Aug 16, 2012 at 2:02 PM, Oxygen XML Editor Support <support@oxygenxml.com <mailto:support@oxygenxml.com>> wrote:
Hello Yves,
I consider that it's more flexible not to add the @type value when a topic ref is inserted. In this way, if the type of the referenced topic changes (it was a task and then you change it to be a concept) then you do not need to remember to also update the <topicref>. What is your usecase? Do you have a CMS which requires the @type to be added?
The DITA 1.2 specs is very vague:
> When a referencing element is first added to or updated in a document, DITA aware editors may, but are not required to, set the type attribute value based on the actual type of a referenced DITA topic.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 8/16/2012 1:07 PM, Yves Barbion wrote: > Hi group > > When I add a topicref to a DITA map, I see that the @type attribute is > left unspecified. It would be nice if the @type attribute would then > automatically be filled in, depending on the information type of the > topic. For example, when I add a topicref to a task topic, the @type > attribute would automatically be type="task". > > Is this possible or is this a new feature request? > > Thanks > > -- > Yves Barbion > www.scripto.nu <http://www.scripto.nu> <http://www.scripto.nu> > > > _______________________________________________ > oXygen-user mailing list > oXygen-user@oxygenxml.com <mailto:oXygen-user@oxygenxml.com> > http://www.oxygenxml.com/mailman/listinfo/oxygen-user > _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com <mailto:oXygen-user@oxygenxml.com> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- Yves Barbion www.scripto.nu <http://www.scripto.nu>

Hi Radu Indeed, I had: <relcolspec type="topic"/> When I remove type="topic", I get generated labels which refer to the information type, so that's OK. Another approach for relationship tables is of course to use dedicated columns for topicrefs of each information type, and specify the @type of <relcolspec> accordingly. Thanks! -- Yves Barbion www.scripto.nu

I completely agree. I often get warnings because the type is inherited from the parent and not set for the child topics. The OT warnings are fairly generic too: System ID: C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap Scenario: User Manual (PDF)1.5.4 O2/Comtech Input file: C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap Engine name: DITA-OT Severity: warning Description: [DOTX019W]: The type attribute on a topicref element does not match the target topic. The type attribute was set to 'reference', 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 cascades in maps, so the value 'reference' may come from an ancestor topicref. Check and make the type attribute on the topicref matches the actual type of topic.The location of this problem was at (File = C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap, Element = topicref:32) As it’s not necessarily simple to find out which reference is 32 (Are there any shortcuts I’m not aware of?), I wrote a php script to parse up the map and return output showing the topicref href and the number. (If anyone wants a copy of this script, let me know.) I also agree with Radu’s point that it’s more flexible not to put it in so that if the topic type changes no map changes are necessary. I’m currently in a mixed authoring environment with both Xmetal/Oxygen and Xmetal always inserts the type. Maybe there could be a tool function to “Insert/Remove topicref types in map” within Oxygen or perhaps the validation could include detecting the specific topics that don’t match the type in the map? It’s not a terrible problem for me as they’re just warnings and I haven’t noticed any adverse effects but I do try to keep my warnings to a minimum. Matt From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Yves Barbion Sent: Thursday, August 16, 2012 5:08 AM To: oXygen User ML Subject: [oXygen-user] Automatically add @type when a topicref is added to a DITA map Hi group When I add a topicref to a DITA map, I see that the @type attribute is left unspecified. It would be nice if the @type attribute would then automatically be filled in, depending on the information type of the topic. For example, when I add a topicref to a task topic, the @type attribute would automatically be type="task". Is this possible or is this a new feature request? Thanks -- Yves Barbion www.scripto.nu<http://www.scripto.nu> AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes. NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.

Hi Matt,
As it’s not necessarily simple to find out which reference is 32 (Are there any shortcuts I’m not aware of?), I wrote a php script to parse up the map and return output showing the topicref href and the number. (If anyone wants a copy of this script, let me know.)
Actually Oxygen has an XPath toolbar so you could open the DITA Map in the main editing area and execute the XPath: (//*[contains(@class, 'topicref')])[32]
I completely agree. I often get warnings because the type is inherited from the parent and not set for the child topics. The OT warnings are fairly generic too: I also agree with Radu’s point that it’s more flexible not to put it in so that if the topic type changes no map changes are necessary.
So you would actually want a consistency in approaches, XMetal adds the @type and Oxygen does not, and because of this the @type added using one editor will be inherited on a child topicref which does not have the @type.
. Maybe there could be a tool function to “Insert/Remove topicref types in map” within Oxygen
The remove could be done using a find/replace in files with regular expressions.
or perhaps the validation could include detecting the specific topics that don’t match the type in the map?
We actually have plans to make the "Validate and check for completeness" report such issues. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/16/2012 4:09 PM, KAATMAN Matthew wrote:
I completely agree. I often get warnings because the type is inherited from the parent and not set for the child topics. The OT warnings are fairly generic too:
System ID: C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap
Scenario: User Manual (PDF)1.5.4 O2/Comtech
Input file: C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap
Engine name: DITA-OT
Severity: warning
Description: [DOTX019W]: The type attribute on a topicref element does not match the target topic. The type attribute was set to 'reference', 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 cascades in maps, so the value 'reference' may come from an ancestor topicref. Check and make the type attribute on the topicref matches the actual type of topic.The location of this problem was at (File = C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap, Element = topicref:32)
As it’s not necessarily simple to find out which reference is 32 (Are there any shortcuts I’m not aware of?), I wrote a php script to parse up the map and return output showing the topicref href and the number. (If anyone wants a copy of this script, let me know.)
I also agree with Radu’s point that it’s more flexible not to put it in so that if the topic type changes no map changes are necessary.
I’m currently in a mixed authoring environment with both Xmetal/Oxygen and Xmetal always inserts the type. Maybe there could be a tool function to “Insert/Remove topicref types in map” within Oxygen or perhaps the validation could include detecting the specific topics that don’t match the type in the map?
It’s not a terrible problem for me as they’re just warnings and I haven’t noticed any adverse effects but I do try to keep my warnings to a minimum.
Matt
*From:*oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] *On Behalf Of *Yves Barbion *Sent:* Thursday, August 16, 2012 5:08 AM *To:* oXygen User ML *Subject:* [oXygen-user] Automatically add @type when a topicref is added to a DITA map
Hi group
When I add a topicref to a DITA map, I see that the @type attribute is left unspecified. It would be nice if the @type attribute would then automatically be filled in, depending on the information type of the topic. For example, when I add a topicref to a task topic, the @type attribute would automatically be type="task".
Is this possible or is this a new feature request?
Thanks
-- Yves Barbion www.scripto.nu <http://www.scripto.nu>
AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes. NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Thanks Radu, I didn't even think about doing an Xpath query, that works perfectly! I think more than consistency between editors, your updated validation check for completeness would be perfect to quickly find these issues quickly when they arise. Then the user can decide how they want to handle the situation. Thanks! Matt -----Original Message----- From: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] On Behalf Of Oxygen XML Editor Support Sent: Thursday, August 16, 2012 9:10 AM To: oxygen-user@oxygenxml.com Subject: Re: [oXygen-user] Automatically add @type when a topicref is added to a DITA map Hi Matt,
As it's not necessarily simple to find out which reference is 32 (Are there any shortcuts I'm not aware of?), I wrote a php script to parse up the map and return output showing the topicref href and the number. (If anyone wants a copy of this script, let me know.)
Actually Oxygen has an XPath toolbar so you could open the DITA Map in the main editing area and execute the XPath: (//*[contains(@class, 'topicref')])[32]
I completely agree. I often get warnings because the type is inherited from the parent and not set for the child topics. The OT warnings are fairly generic too: I also agree with Radu's point that it's more flexible not to put it in so that if the topic type changes no map changes are necessary.
So you would actually want a consistency in approaches, XMetal adds the @type and Oxygen does not, and because of this the @type added using one editor will be inherited on a child topicref which does not have the @type.
. Maybe there could be a tool function to "Insert/Remove topicref types in map" within Oxygen
The remove could be done using a find/replace in files with regular expressions.
or perhaps the validation could include detecting the specific topics that don't match the type in the map?
We actually have plans to make the "Validate and check for completeness" report such issues. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/16/2012 4:09 PM, KAATMAN Matthew wrote:
I completely agree. I often get warnings because the type is inherited from the parent and not set for the child topics. The OT warnings are fairly generic too:
System ID: C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap
Scenario: User Manual (PDF)1.5.4 O2/Comtech
Input file: C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap
Engine name: DITA-OT
Severity: warning
Description: [DOTX019W]: The type attribute on a topicref element does not match the target topic. The type attribute was set to 'reference', 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 cascades in maps, so the value 'reference' may come from an ancestor topicref. Check and make the type attribute on the topicref matches the actual type of topic.The location of this problem was at (File = C:\dita\products\simon\EN\Simon_Plus_User_Manual.ditamap, Element = topicref:32)
As it's not necessarily simple to find out which reference is 32 (Are there any shortcuts I'm not aware of?), I wrote a php script to parse up the map and return output showing the topicref href and the number. (If anyone wants a copy of this script, let me know.)
I also agree with Radu's point that it's more flexible not to put it in so that if the topic type changes no map changes are necessary.
I'm currently in a mixed authoring environment with both Xmetal/Oxygen and Xmetal always inserts the type. Maybe there could be a tool function to "Insert/Remove topicref types in map" within Oxygen or perhaps the validation could include detecting the specific topics that don't match the type in the map?
It's not a terrible problem for me as they're just warnings and I haven't noticed any adverse effects but I do try to keep my warnings to a minimum.
Matt
*From:*oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] *On Behalf Of *Yves Barbion *Sent:* Thursday, August 16, 2012 5:08 AM *To:* oXygen User ML *Subject:* [oXygen-user] Automatically add @type when a topicref is added to a DITA map
Hi group
When I add a topicref to a DITA map, I see that the @type attribute is left unspecified. It would be nice if the @type attribute would then automatically be filled in, depending on the information type of the topic. For example, when I add a topicref to a task topic, the @type attribute would automatically be type="task".
Is this possible or is this a new feature request?
Thanks
-- Yves Barbion www.scripto.nu <http://www.scripto.nu>
AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes. NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes. NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.
participants (3)
-
KAATMAN Matthew
-
Oxygen XML Editor Support
-
Yves Barbion