Map transformation that runs XSLT transformation on the topi
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Map transformation that runs XSLT transformation on the topi
Post by Frank Ralf »
Hi,
I want to create a map transformation which runs a normal XSLT transformation on every topic. The use case is a software block (map) with each function described in a separate topic. The XSLT transformation shall generate a header file from all the topics referenced in the map. The output shall be one header file containing all functions for the software block.
Any pointers welcome
TIA
Frank
I want to create a map transformation which runs a normal XSLT transformation on every topic. The use case is a software block (map) with each function described in a separate topic. The XSLT transformation shall generate a header file from all the topics referenced in the map. The output shall be one header file containing all functions for the software block.
Any pointers welcome
TIA
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Map transformation that runs XSLT transformation on the
Hi Frank,
You may want to take a look at the XSL George wrote which gets applied on a DITA Map and generates a report for content loaded from all referenced topics:
OXYGEN_INSTALL_DIR\frameworks\dita\report\report.xsl
When applied on the root map element the template gets all the content of the DITA Map expanded in a single variable:
That merged content is obtained by calling templates from the XSLT module:
OXYGEN_INSTALL_DIR\frameworks\dita\report\modules\resolve.xsl
which you could probably re-use completely in your XSLT stylesheet.
After you have the content with all topicrefs expanded in a single variable, you can do anything you want with it.
Regards,
Radu
You may want to take a look at the XSL George wrote which gets applied on a DITA Map and generates a report for content loaded from all referenced topics:
OXYGEN_INSTALL_DIR\frameworks\dita\report\report.xsl
When applied on the root map element the template gets all the content of the DITA Map expanded in a single variable:
Code: Select all
<xsl:variable name="resolved">
<oxyd:mapref xml:base="{document-uri(.)}">
<xsl:apply-templates select="/" mode="resolve"/>
</oxyd:mapref>
</xsl:variable>
OXYGEN_INSTALL_DIR\frameworks\dita\report\modules\resolve.xsl
which you could probably re-use completely in your XSLT stylesheet.
After you have the content with all topicrefs expanded in a single variable, you can do anything you want with it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: Map transformation that runs XSLT transformation on the
Post by Frank Ralf »
Hi Radu,
Many thanks, that looks great! I will give it a try and report back.
Kind regards,
Frank
Many thanks, that looks great! I will give it a try and report back.
Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: Map transformation that runs XSLT transformation on the
Post by Frank Ralf »
Hi Radu,
I got this working in principle, using the code-snippet from report.xsl. Some hints for others who want to give it a try:
Frank
I got this working in principle, using the code-snippet from report.xsl. Some hints for others who want to give it a try:
- 1. For instructions on multiple transformations (pipelining) in one stylesheet see http://www.oxygenxml.com/archives/xsl-l ... 00406.html.
2. Because resolve.xsl uses some XSLT 2.0 features you have to make sure to choose a XSLT 2 capable engine in your transformation scenario.
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
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)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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