Extracting attribute values through XPaths
Posted: Wed Apr 02, 2014 6:36 pm
Hi,
I'd like to create an action button that extracts the value of a specific attribute (the "base" attribute in this case), and automatically inserts this value as text in a specific element (the <category> element). Preferably, this action can occur as soon as a value is selected for the base attribute, but we can also have it so that once the value is selected, pressing a button automatically populates the <category> element with the correct value.
In the example below, I'd like the two category elements to contain the "Video" and "Alarms", without having to enter these values manually. Our values for the "base" attribute are defined in a subject scheme map that is included in the bookmap.
Any ideas on how we can go about this? Which XPath expressions should we use?
Thank you
Example code:
I'd like to create an action button that extracts the value of a specific attribute (the "base" attribute in this case), and automatically inserts this value as text in a specific element (the <category> element). Preferably, this action can occur as soon as a value is selected for the base attribute, but we can also have it so that once the value is selected, pressing a button automatically populates the <category> element with the correct value.
In the example below, I'd like the two category elements to contain the "Video" and "Alarms", without having to enter these values manually. Our values for the "base" attribute are defined in a subject scheme map that is included in the bookmap.
Any ideas on how we can go about this? Which XPath expressions should we use?
Thank you
Example code:
Code: Select all
<metadata>
<category base="Video"/>
<category base="Alarms"/>
<keywords>
<indexterm>video</indexterm>
</keywords>
</metadata>
</prolog>