SHOW:
|
|
- or go back to the newest paste.
| 1 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" version="1.0"> | |
| 2 | <xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="yes"/> | |
| 3 | <xsl:variable name="main" select="/data"/> | |
| 4 | <xsl:template name="myTemplate"> | |
| 5 | <xsl:param name="myparam"/> | |
| 6 | <xsl:param name="node"/> | |
| 7 | ||
| 8 | Node: <xsl:value-of select="$node"/><br/> | |
| 9 | - | Inner1:<xsl:value-of select="msxsl:node-set($myparam)"/> |
| 9 | + | Inner:<xsl:value-of select="msxsl:node-set($myparam)/data/*[local-name() = $node][1]"/> |
| 10 | - | <br/> |
| 10 | + | |
| 11 | - | Inner2:<xsl:value-of select="msxsl:node-set($myparam)/data/*[local-name() = $node][1]"/> |
| 11 | + | |
| 12 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| 13 | HTML STARTS | |
| 14 | <br/> | |
| 15 | <xsl:variable name="data" select="."/> | |
| 16 | Outer1:<xsl:value-of select="$data"/> | |
| 17 | <br/> | |
| 18 | Outer2:<xsl:value-of select="$data/foobar"/> | |
| 19 | <br/> | |
| 20 | <xsl:variable name="defaultMetadata" select="document('metadata.xml')"/>
| |
| 21 | <xsl:for-each select="msxsl:node-set($defaultMetadata)/Metadata/Data/Detail"> | |
| 22 | <br/>----<br/> | |
| 23 | <xsl:call-template name="myTemplate"> | |
| 24 | <xsl:with-param name="node"> | |
| 25 | <xsl:value-of select="."></xsl:value-of> | |
| 26 | </xsl:with-param> | |
| 27 | ||
| 28 | <xsl:with-param name="myparam"> | |
| 29 | <xsl:copy-of select="$data"/> | |
| 30 | </xsl:with-param> | |
| 31 | </xsl:call-template> | |
| 32 | ||
| 33 | </xsl:for-each> | |
| 34 | </html> | |
| 35 | </xsl:template> | |
| 36 | </xsl:stylesheet> |