create single output files
Oxygen general issues.
-
- Posts: 1
- Joined: Mon Nov 08, 2010 7:36 pm
create single output files
Post by stattersall »
I am new to oxygen and I have setup a custom transformation scenario to transform multiple xml files with a single xslt stylesheet. Instead of creating multiple output files following the transformation, I want to merge all transformation into a single .html output file.
Can someone advise on this please.
regards,
Steve Tattersall
Can someone advise on this please.
regards,
Steve Tattersall
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: create single output files
Hi Steve,
XSLT 2.0 has support for processing multiple XML input files and Oxygen comes bundled with the Saxon 9 Enterprise Edition XSLT processor which has full XSLT 2.0 support. The XSLT 2.0 function you can use is called collection().
So for example if your XML files have the following structure:
a sample XSLT 2.0 stylesheet like:
would iterate all your XML files from a certain directory and gather with an XPath all <person> elements from them.
You can apply the XSLT stylesheet on any XML file as it will only be interested in processing the files in the collection.
Regards,
Radu
XSLT 2.0 has support for processing multiple XML input files and Oxygen comes bundled with the Saxon 9 Enterprise Edition XSLT processor which has full XSLT 2.0 support. The XSLT 2.0 function you can use is called collection().
So for example if your XML files have the following structure:
Code: Select all
<root>
<person>
.....
</person>
.....
<person>
.....
</person>
.....
</root>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<html>
<body>
<!-- Iterate all XML files in the "file:/D:/projects/eXml/samples/" directory and get all "person" elements from them -->
<xsl:variable name="allPersons" select="collection('file:/D:/projects/eXml/samples/?select=*.xml')//person"/>
<xsl:for-each select="$allPersons">
<!--Here you can match each person and output HTML from it-->
<xsl:copy-of select="."/>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
You can apply the XSLT stylesheet on any XML file as it will only be interested in processing the files in the collection.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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