P
Patrik Carlsson
I have a problem using Xerces with a template for
a generic page-header getting a sub-tree as argument.
The same stylesheet is working flawlessly in IE and
Mozilla, though it would be nice to have a result-file
to work with too.
Here is an example (xerces only get a collapsed string through),
any suggestions or current bug-reports are welcome.
/ Patrik
My "paramtest.xml" :
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="sendparam.xsl"?>
<rootnode>
<treenode>
<organization>The Apache Software Foundation</organization>
<street>1901 Munsey Drive</street>
<address>Forest Hill, MD 21050-2747</address>
<country>U.S.A</country>
</treenode>
<othernode>
othernode
</othernode>
</rootnode>
The stylesheet "sendparam.xsl" sending a node as parameter :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslutput method="xml" indent="yes"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
encoding="ISO-8859-1" />
<xsl:include href="getparam.xsl"/>
<xsl:template match="rootnode">
<xsl:variable name="treecopy">
<xsl:copy-of select="treenode"/>
</xsl:variable>
<xsl:call-template name="testtemplate">
<xsl:with-param name="paramtree" select="$treecopy"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
A generic stylesheet "getparam.xsl" using the parameter :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslutput method="xml" indent="yes"
encoding="ISO-8859-1" />
<xsl:template name="testtemplate">
<xslaram name="paramtree">no recipent</xslaram>
<xsl:for-each select="$paramtree/treenode/*">
<b>
<xsl:value-of select="."/>
</b>
<br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
a generic page-header getting a sub-tree as argument.
The same stylesheet is working flawlessly in IE and
Mozilla, though it would be nice to have a result-file
to work with too.
Here is an example (xerces only get a collapsed string through),
any suggestions or current bug-reports are welcome.
/ Patrik
My "paramtest.xml" :
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="sendparam.xsl"?>
<rootnode>
<treenode>
<organization>The Apache Software Foundation</organization>
<street>1901 Munsey Drive</street>
<address>Forest Hill, MD 21050-2747</address>
<country>U.S.A</country>
</treenode>
<othernode>
othernode
</othernode>
</rootnode>
The stylesheet "sendparam.xsl" sending a node as parameter :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslutput method="xml" indent="yes"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
encoding="ISO-8859-1" />
<xsl:include href="getparam.xsl"/>
<xsl:template match="rootnode">
<xsl:variable name="treecopy">
<xsl:copy-of select="treenode"/>
</xsl:variable>
<xsl:call-template name="testtemplate">
<xsl:with-param name="paramtree" select="$treecopy"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
A generic stylesheet "getparam.xsl" using the parameter :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslutput method="xml" indent="yes"
encoding="ISO-8859-1" />
<xsl:template name="testtemplate">
<xslaram name="paramtree">no recipent</xslaram>
<xsl:for-each select="$paramtree/treenode/*">
<b>
<xsl:value-of select="."/>
</b>
<br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>