Using XPath with reusable content
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 167
- Joined: Tue Mar 06, 2018 1:34 am
Using XPath with reusable content
I am developing a set of procedures that all have unique names and ID codes.
I want to create a "master list" of procedure names and ID codes. My first thought was to use raw XML, like this:
Now, when I create each task file, I want the title of each task to pull from this XML document. I would use XPath to do this.
But I don't understand where I tell Oxygen to use XPath to pull content from another reference.
Am I thinking about this correctly? Is there a better way to do this, like is this what a "key map" is?
I want to create a "master list" of procedure names and ID codes. My first thought was to use raw XML, like this:
Code: Select all
<master-list>
<entry>
<procedure-name>Remove Component 1</procedure-name>
<unique-id>1234</unique-id>
</entry>
<entry>
<procedure-name>Remove Component 2</procedure-name>
<unique-id>5678</unique-id>
</entry>
<master-list>
But I don't understand where I tell Oxygen to use XPath to pull content from another reference.
Am I thinking about this correctly? Is there a better way to do this, like is this what a "key map" is?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Using XPath with reusable content
Post by alex_jitianu »
Hello,
You can create Document Templates that use the ${xpath_eval(expression)} editor variable to extract the data from the file and further process it as needed. To access the "master list" file you ca:
- use the ${pdu} editor variable, if you are using Oxygen project files and the master file is somewhere in the project directory.
- add a mapping in a catalog file (perhaps the catalog from a framework) between a generic URL and the location of the file. In the XPath expression you use the generic URL.
To avoid duplicating that ${xpath_eval(expression)} in every document template, you can create a custom editor variable that maps to that long ${xpath_eval(expression)}, like an alias. Afterwards, in the document templates, you can use the custom editor variable which is shorter.
By the way, which XML vocabulary are you using? Is it DITA or a proprietary one?
Best regards,
Alex
You can create Document Templates that use the ${xpath_eval(expression)} editor variable to extract the data from the file and further process it as needed. To access the "master list" file you ca:
- use the ${pdu} editor variable, if you are using Oxygen project files and the master file is somewhere in the project directory.
- add a mapping in a catalog file (perhaps the catalog from a framework) between a generic URL and the location of the file. In the XPath expression you use the generic URL.
To avoid duplicating that ${xpath_eval(expression)} in every document template, you can create a custom editor variable that maps to that long ${xpath_eval(expression)}, like an alias. Afterwards, in the document templates, you can use the custom editor variable which is shorter.
By the way, which XML vocabulary are you using? Is it DITA or a proprietary one?
Best regards,
Alex
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service