<?xml version="1.0"?>
<!-- Test XSLT. You must put in real directories in 'file:///c:/someDir/anotherDir/?select=*.(xsl|xslt)' to get it working. -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    <xsl:template match="/">
        <xsl:result-document href="filenames.html" indent="yes">
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
                <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                    <title>Test of collection() function</title>
                    <style type="text/css">
                        table{border-collapse: collapse; empty-cells:show}
                        th, td{border: 1px solid silver}
                        th{background-color:whitesmoke}
                    </style>
                </head>
                <body>
                    <h1>My XSLT stylesheets</h1>
                    <table cellspacing="0" cellpadding="5">
                        <tr><th>No</th><th>Filename</th><th>Version</th></tr>
                        <xsl:for-each select="collection(iri-to-uri('file:///c:/someDir/anotherDir/?select=*.(xsl|xslt)'))">
                            <tr><td><xsl:value-of select="position()"/></td><td><xsl:value-of select="tokenize(document-uri(.), '/')[last()]"/></td><td><xsl:value-of select="./xsl:stylesheet/@version"/></td></tr>
                        </xsl:for-each>
                    </table>
                </body>
            </html>
        </xsl:result-document>
    </xsl:template>
</xsl:stylesheet>