oxy_xpath with doc() in css, or force an action from oxy_combobox
Posted: Fri Jan 20, 2017 12:35 am
I have a problem where I have a document with elements with a code attribute with numerical values that ideally should be looked up in another document to get a text meaning for the code.
I've tried to use the below css style (simplified with a hard coded code value). Only the "Test: " string is visible in the styled document. If I don't concat anything to the xpath results, nothing is displayed. I know the url path in doc() is right because if I deliberately make it incorrect I get an error message for every case of socm element when the document is styled, so I also know that the doc() function is being executed.
socm
I've tried to use the below css style (simplified with a hard coded code value). Only the "Test: " string is visible in the styled document. If I don't concat anything to the xpath results, nothing is displayed. I know the url path in doc() is right because if I deliberately make it incorrect I get an error message for every case of socm element when the document is styled, so I also know that the doc() function is being executed.
socm
Code: Select all
:before {
display: inline;
content: oxy_concat("Test: ", oxy_xpath("doc('file:/C:/Users/Doug/Documents/work/collection_materials/frameworks/docbook/css/ocm.xml')//category[@code='101']/@term/string()"));
font-size: 10pt;
color:blue;
text-transform: capitalize;
}
A snippet of the lookup document is like:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<category code="100" term="ORIENTATION">
</category>
<category code="101" term="IDENTIFICATION">
</category>
<category code="102" term="MAPS">
</root>
Alternatively I could add a separate attribute of @term on the socm element with the corresponding text for code value, but I don't really want the text to be static in the styled document, and, two, I am allowing new code values to be changed with a combobox form and I can only update one attribute with the combobox. Is there anyway to trigger an action from a combobox to update the corresponding term attribute?
A snippet from the styled document, with less desirable corresponding term attribute looks like:
<sowc code="aw11" term="Kerala">
<socm code="101" term="Identification"/>
<socm code="131" term="Location"/>
<socm code="133" term="Topography and geology"/>
<socm code="174" term="Historical reconstruction"/>
</sowc>
</sid>