[oXygen-user] Automatically add @type when a topicref is added to a DITA map

KAATMAN Matthew matthew.kaatman at biomerieux.com
Thu Aug 16 09:17:43 CDT 2012


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 at oxygenxml.com [mailto:oxygen-user-bounces at oxygenxml.com] On Behalf Of Oxygen XML Editor Support
Sent: Thursday, August 16, 2012 9:10 AM
To: oxygen-user at 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 at oxygenxml.com
> [mailto:oxygen-user-bounces at 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 at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>
_______________________________________________
oXygen-user mailing list
oXygen-user at 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.




More information about the oXygen-user mailing list