Reading DITA-OT variables (en.xml) in Author mode CSS

Post here questions and problems related to editing and publishing DITA content.
jonas
Posts: 6
Joined: Wed Jan 21, 2015 12:29 pm

Reading DITA-OT variables (en.xml) in Author mode CSS

Post by jonas »

Dear oXygen team,

in my DITA-OT PDF plugin, I use the Customization/common/vars/en.xml file to add legal content.
The generation of legal content is triggered by data elements in the map file, for example: <data name="disclaimer" value="t001dis102"/>

As the value provides only an ID, I want to show a description of the legal content in Author mode. The description would be something like "Disclaimer on xxx" and is already available in the en.xml file.

I managed this in the css file:

Code: Select all


*[class ~= "topic/data"][name='disclaimer'][value='t001dis102']{
content:
oxy_editor(
type, text,
edit, "@value",
editable, true,
);
": "
oxy_xpath(
"doc('file:/T:/myDITAFramework/DITA-OT/plugins/myPDFPlugin/Customization/common/vars/en.xml')//*[@id='t001dis102- dt']/text()"
);
;
}
But I did not succeed to generalize it. I tried to use other variables inside the oxy_xpath expression, but it did not work.
I want to do the following:
  • Generalize the statement for any @value attribute. I need to reuse the @value attribute of the data element in my oxy_xpath expression.
  • As we are sharing our framework via SVN, I need to access en.xml with an relative path (from the css file or from the framework directory). The following did not work:
    • doc('../DITA-OT/plugins/myPDFPlugin/Customization/common/vars/en.xml') --> relative from CSS
    • doc('${env(myDITAFramework)}/DITA-OT/plugins/myPDFPlugin/Customization/common/vars/en.xml') --> using environment variable
    • using catalog files
    • using URL in SVN repository (authentification problems)
Do you have any ideas for oXygen 16.1?

Best regards,
Jonas
Radu
Posts: 9472
Joined: Fri Jul 09, 2004 5:18 pm

Re: Reading DITA-OT variables (en.xml) in Author mode CSS

Post by Radu »

Hi Jonas,

I would do that something like:

Code: Select all


*[class ~= "topic/data"][name='disclaimer'][value]{
content:
oxy_editor(
type, text,
edit, "@value",
editable, true),
": "
oxy_xpath(
oxy_concat("doc('", oxy_url("../../DITA-OT/plugins/myPDFPlugin/Customization/common/vars/en.xml"), "')//*[@id='", attr(value), "- dt']/text()")
);
}
So that I can compose the xpath expression using the oxy_concat function and calling other Oxygen functions to get the attribute value and to compute an absolute URL relative to the CSS.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jonas
Posts: 6
Joined: Wed Jan 21, 2015 12:29 pm

Re: Reading DITA-OT variables (en.xml) in Author mode CSS

Post by jonas »

Hi Radu,

thanks a lot. That works.

Best regards,
Jonas
Post Reply