How to add an DITA-OT extension point as a DITA parameter in a batch file?

69 views
Skip to first unread message

Diane Gratton

unread,
Jul 19, 2018, 12:49:35 AM7/19/18
to DITA-OT Users
I am trying to change some of the DITA generated text by using the extension point  "dita.xsl.stringsas a DITA paramenter in my batch file.

-Ddita.xsl.strings=%customDir%\common\vars\custom-strings.xml 

Is this supported? not working...

Radu Coravu

unread,
Jul 19, 2018, 2:48:46 AM7/19/18
to Diane Gratton, DITA-OT Users
Hi Diane,

You cannot specify an extension point as a command line parameter.
A plugin extension point can be specified by creating a DITA OT plugin which contributes a value for it.
As an example, you would have a plugin folder containing a plugin.xml with the content:

<plugin id="my.plugin.id">
  <feature extension="dita.xsl.strings" value="strings.xml" type="file"/>
</plugin>

with the strings.xml containing something like:

<langlist>
    <lang xml:lang="en"    filename="strings-en-us.xml"/>
    <lang xml:lang="en-ca" filename="strings-en-us.xml"/>
    <lang xml:lang="en-gb" filename="strings-en-us.xml"/>
    <lang xml:lang="en-us" filename="strings-en-us.xml"/>
</langlist>

and the "strings-en-us.xml" containing something like:

<strings xml:lang="en-us">
   <str name="key.name">Translated Value</str>
</strings>

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Radu Coravu

unread,
Jul 19, 2018, 2:49:46 AM7/19/18
to Diane Gratton, DITA-OT Users
Hi,

And of course after creating your plugin folder, you need to copy it to the DITA OT "plugins" folder and install it:


Regards,
Radu

Diane Gratton

unread,
Jul 19, 2018, 8:44:03 PM7/19/18
to DITA-OT Users
Thanks Radu, 

I wanted to simply use the link to the customization folder and not create plugins for each document variations.
Simply changing customization folder was an easy solution and could be implemented with a batch file.  
If making changes to the generated text with DITA-OT 3.x can only be done within a plugin, then the option of using a customization directory no longer makes sense. 

Radu Coravu

unread,
Jul 20, 2018, 12:56:19 AM7/20/18
to Diane Gratton, DITA-OT Users
Hi Diane,

Your initial email does not mention a customization folder, it does not even mention the output that you want to obtain from DITA.
DITA OT 3.x still has support for PDF customization folders using the "customization.dir" parameter.
Indeed a PDF customization folder can also make variable overrides:


Regards,
Radu

--

Diane Gratton

unread,
Jul 22, 2018, 11:45:07 PM7/22/18
to DITA-OT Users
I am following the DITA-OT 3.1 example to generate the "task" labels.  

Just not working for me... 

I have no problems modifying the content of other variables in the en.xml files by using my own customized en.xml (the old way), 
it is the strings in the dita-ot-3.1\xsl\common\strings-en-us.xml that I can't seem to modify.

So I followed the indicated method:


The above  DITA-OT 3.1 reference explains that  to modify your labels you need to declare an extension point.  

When using a customization directory, I tried included the extension point in my batch file.


When using a plugin, I tried to include the extension point as a feature in my plugin file.



According to the above reference, I should be able to modify all the strings called by the getVariable method.



The strings declared in the customized xml file, the reference claims, will now be available for the getVariable template.

If anyone has managed to modify the "Task Example" or "Task Result" labels using this method with DITA-OT 3.1, please share your secret.

Diane

On Wednesday, 18 July 2018 21:49:35 UTC-7, Diane Gratton wrote:

Diane Gratton

unread,
Jul 24, 2018, 12:45:23 AM7/24/18
to DITA-OT Users
Corrections for the strings-en-us.xml/custom-en-us.xml file:



On Wednesday, 18 July 2018 21:49:35 UTC-7, Diane Gratton wrote:

Michael Morrison

unread,
Jul 25, 2018, 4:57:32 PM7/25/18
to DITA-OT Users
Diane - 

I have made changes to global strings using an extension point for my Eclipse help plugin using DOT 2.4. Here's what I did, so you can compare with what you have (mainly because I can't see the content of your custom-strings.xml file).

In plugin.xml:

<!-- MCM: Define string file -->    
<feature extension="dita.xsl.strings" file="cfg/strings.xml"/>

Then, in cfg/strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<langlist>  
  <lang xml:lang="en" filename="strings-en-us.xml"/>
  <lang xml:lang="en-us" filename="strings-en-us.xml"/>
</langlist>

Then, in strings-en-us.xml:

<?xml version="1.0" encoding="utf-8"?>
<strings xml:lang="en-us">
  <!-- peril notice labels -->
  <str name="Note">NOTE</str>
  <str name="Tip">TIP</str>    
  <str name="Important">IMPORTANT</str>    
  <str name="Caution">CAUTION</str>
  <str name="Danger">DANGER</str>  
  
  <!-- Related info label -->
  <str name="For more information">For more information</str> 
</strings>

I do not use your -Ddita.xsl.strings=... parm in the .bat file (maybe this is needed for DOT 3 but not for 2.x?).

When I generate Eclipse help, I see upper case peril notice labels, and the related info label as expected.  I'm not sure why yours doesn't work, unless it's a problem with DOT 3.x?  Maybe someone else can see why your method isn't working.  Good luck!

Cheers,
Michael
Reply all
Reply to author
Forward
0 new messages