|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Merging an dynamic set of XML files into 1 with ANT /
Hello
I have to extract XML elements from a set of XML files, and to gather these
elements into one XML file.
(Let's imagine each XML file is a chapter, and I want to extract Title element
to build the Table Of Contents)
I have to do this using an ANT target.
My main problem is that is must be DYNAMIC : I have to scan the contents of a
folder, sort files alphabetically, and build the TOC according to that.
I already wrote something STATIC (list of file hardcoded in the ANT file) :
I have one XSLT task which add a new chapter title to the TOC, passing the XML
file as an XSLT parameter.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:param name="P_moduleFile"/>
<xsl:variable name="modDoc" select="document($P_moduleFile)"/>
<!-- identity template -->
<xsl:template match="@* | node()">
<xsl:copy><xsl:apply-templates select="@* | node()"/></xsl:copy>
</xsl:template>
<xsl:template match="/*">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<module>
<xsl:attribute name="name"><xsl:value-of
select="$modDoc/STR-module/@name"/></xsl:attribute>
<xsl:apply-templates select="$modDoc/STR-module/text"/>
<xsl:apply-templates select="$modDoc/STR-module/description"/>
</module>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Any idea how to make a DYNAMIC version of this ?
Regards
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








