Stefan Schmitz
Usenet Archive
- Joined
- Feb 9, 2005
- Messages
- 1
- Reaction score
- 0
I have a problem using a global parameter to control the XSL-Transformation of my XML-Document.
My XML-Document looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Football xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="d:\_Privat\Football\XML\Football.xsd"> <Season> <Opponents> <Opponent ID="ID1001" Town="Duesseldorf"/> </Opponents> </Season> <Football>
And my XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl
utput method="html" encoding="UTF-8" indent="no"/>
<xsl
aram name="Selection" select="Try"/>
<xsl:template match="Football">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="Season">
<head>
<title>
<xsl:text>Saison </xsl:text>
<xsl:value-of select="@Year"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="$Selection"/>
<xsl:text>)</xsl:text>
</title>
</head>
<body>
<center>
<xsl:text><xsl:value-of select="$Selection"/></xsl:text> </center> </body> </xsl:template>
If I transform the XML-Document with this stylesheet the value-of($Selection)-Part is in both cases empty. If I change the select-Value to 1 or 12 (Number) or add this to the Xalan-Transformator (-p Selection 1) as a parameter the given value appears. But I can't understand why this only works with numbers? What am I doing wrong?
Thanks
Stefan
My XML-Document looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Football xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="d:\_Privat\Football\XML\Football.xsd"> <Season> <Opponents> <Opponent ID="ID1001" Town="Duesseldorf"/> </Opponents> </Season> <Football>
And my XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl
<xsl
<xsl:template match="Football">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="Season">
<head>
<title>
<xsl:text>Saison </xsl:text>
<xsl:value-of select="@Year"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="$Selection"/>
<xsl:text>)</xsl:text>
</title>
</head>
<body>
<center>
<xsl:text><xsl:value-of select="$Selection"/></xsl:text> </center> </body> </xsl:template>
If I transform the XML-Document with this stylesheet the value-of($Selection)-Part is in both cases empty. If I change the select-Value to 1 or 12 (Number) or add this to the Xalan-Transformator (-p Selection 1) as a parameter the given value appears. But I can't understand why this only works with numbers? What am I doing wrong?
Thanks
Stefan