Wednesday, 25 February 2015

generating a document with list of files in a directory using xslt 2.0



I have a bunch of folder with party xml files and partly binary image files.


I am generating a list of those files, using the following:



<xsl:variable name="string" select="iri-to-uri(concat(@name, '/?select=*.(xml|gxf)'))"/>
<xsl:variable name="input" select="collection($string)"/>
<xsl:for-each select="$input">
<file>
<xsl:value-of select="tokenize(document-uri(.), '/')[last()]"/>
</file>
</xsl:for-each>


Works well, except of course for the binary files. How could I get the uri of those files? Is that possible with pure xslt 2.0 using saxon9he?


No comments:

Post a Comment