[Home] [By Thread] [By Date] [Recent Entries]
Martin Honnen wrote:
XemonerdX wrote: If you need/want to use XSLT 1.0 then you need to make sure you pass parameters explicitly on in all templates that are used, in particular that identity transformation template: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" indent="yes"/> <xsl:variable name="data" select="/"/> <xsl:variable name="layout" select="document('test2008070402.xml')"/> <xsl:template match="/"> <xsl:apply-templates select="$layout/layout/layout-main/*"/> </xsl:template> <!-- transformations --> <xsl:template match="insert-name"> <xsl:value-of select="$data/top/data/name"/> </xsl:template> <xsl:template match="insert-title"> <xsl:value-of select="$data/top/data/title"/> </xsl:template> <xsl:template match="insert-cells"> <xsl:for-each select="$data/top/cells/cell"> <xsl:variable name="name" select="name"/> <xsl:variable name="value" select="value"/> <xsl:apply-templates select="$layout/layout/layout-cell/tr"> <xsl:with-param name="name" select="$name"/> <xsl:with-param name="value" select="$value"/> </xsl:apply-templates> </xsl:for-each> </xsl:template> <xsl:template match="insert-cell-name"> <xsl:param name="name"/> <xsl:value-of select="$name"/> </xsl:template> <xsl:template match="insert-cell-value"> <xsl:param name="value"/> <xsl:value-of select="$value"/> </xsl:template> <!-- Identity transformation --> <xsl:template match="@*|node()"> <xsl:param name="name"/> <xsl:param name="value"/> <xsl:copy> <xsl:apply-templates select="@*|node()"> <xsl:with-param name="name" select="$name"/> <xsl:with-param name="value" select="$value"/> </xsl:apply-templates> </xsl:copy> </xsl:template> </xsl:stylesheet> -- Martin Honnen http://JavaScript.FAQTs.com/
|

Cart



