Node tests: get element under the xsl:template : element function « XSLT stylesheet « XML






Node tests: get element under the xsl:template



<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <html>
      <body>
        <textarea rows="10" cols="60">
          <xsl:copy-of
            select="document('')/*/xsl:template//element()[2]" />
        </textarea>
        <br />
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

Output:

<html>
   <body><textarea rows="10" cols="60"><br xmlns:xsl="http://www.w3.org/1999/XSL/Transform"></textarea><br></body>
</html>

 








Related examples in the same category