type="notice" attribute for note and hazardstatement elements

Post here questions and problems related to editing and publishing DITA content.
steinbacherGE
Posts: 55
Joined: Tue Mar 13, 2018 6:07 pm

type="notice" attribute for note and hazardstatement elements

Post by steinbacherGE »

I'm getting unexpected results when publishing the type="notice" attribute for both note and hazardstatement elements.

Publishing to Webhelp Responsive (dita-ot 3.3.1 - WHR 21).

xml:lang="en"

note type="notice"
hazardstatement type="notice"
typeNotice.png
typeNotice.png (8.41 KiB) Viewed 2095 times
Why is gentext for type="notice" still "note"?

xml:lang="de"

note type="notice"
hazardstatement type="notice"
typeNotice-de.png
typeNotice-de.png (8.25 KiB) Viewed 2095 times
Maybe German is not best example because note and notice are both tranlsated into hinweis, but why is the gentext missing for hazardstatement type="notice"?

Thanks,

Leroy
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: type="notice" attribute for note and hazardstatement elements

Post by radu_pisoi »

Hi,

Thank you for reporting this issue.

There are two cases here for note and hazardstatement elements with @type= notice attribute.

Please note that both issues are related with DITA-OT HTML5 plugin that WebHelp plugin extends.

1. For note element, there is no implementation difference for @type= note and @type= notice, the generated text is the same.
If you want to fix this issue, you can use the dita.xsl.html5 XSLT extension point to override the following XSLT template:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/note ')]" name="topic.note">
XSLT file:

Code: Select all

{$DITA-OT-DIR}/plugins/org.dita.html5/xsl/topic.xsl
2. For hazardstatement element you can override the generated text by modifying the translation files. Please read the Modifying the Existing Strings procedure from our user guide.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
steinbacherGE
Posts: 55
Joined: Tue Mar 13, 2018 6:07 pm

Re: type="notice" attribute for note and hazardstatement elements

Post by steinbacherGE »

Thanks for the response. I was able to fix the issue for English output. However, the translated string for "Notice" is still not coming through.

I created a localization plugin and added the string to strings-de-de.xml. I also modified (Dude!) a few others to make sure this file is being used.

Image (Trying to add screenshots but it is not letting me add any more attachments.)

The generated text shows up in Oxygen Editor, but the translation for "Notice" is missing in my German output.

Image (Not sure where my screenshot attachments went)
Attachments
Notice-Sting-de.png
Notice-Sting-de.png (21.72 KiB) Viewed 2012 times
Notice-Sting-de.png
Notice-Sting-de.png (21.72 KiB) Viewed 2012 times
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: type="notice" attribute for note and hazardstatement elements

Post by radu_pisoi »

Hi,

As I told you in the previous email, I think it is necessary to implement an XSLT extension point to change the generated text for a note element with @type='notice'.

Code: Select all

<note type="notice">This is a note with @type='notice'</note>
If you want to fix this issue, you can use the dita.xsl.html5 XSLT extension point to override the following XSLT template:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/note ')]" name="topic.note">
XSLT file:

Code: Select all

{$DITA-OT-DIR}/plugins/org.dita.html5/xsl/topic.xsl
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
steinbacherGE
Posts: 55
Joined: Tue Mar 13, 2018 6:07 pm

Re: type="notice" attribute for note and hazardstatement elements

Post by steinbacherGE »

Thanks Radu. I was able to get the type="notice" translation string to work. I had to rename it notice-GE and add a special conditional statement to specifically pull in that variable. I can share the code if anyone else has the same issue.

Thanks,

Leroy
sudarshan_gr
Posts: 1
Joined: Wed Feb 24, 2021 6:24 am

Re: type="notice" attribute for note and hazardstatement elements

Post by sudarshan_gr »

Could you please share the code to change the type="notice" attribute for note and hazard statement elements for webhelp output.

Thanks and regards,
Sudarshan
Post Reply