J
jose.jeria
I just started looking at XSLT, so bare with me if I totally
misunderstood this.
I am passing a value to the xslt that i want to use to search in some
nodes. I have the following code for this (note the query parameter):
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput
media-type="text/xml"
method="html"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
encoding="UTF-8"/>
<xslaram name="query"/>
<xsl:template match="/">
<html>
<head>
<title>Search results</title>
</head>
<body>
<h1>Found <xsl:value-of
select="count(/airports/airport/country_name[starts-with(.,$query)])"/>
countries</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Issue is that this doesn't work. If i "hardcode" a string it works. Do
I need to convert it to a string first?
Thank you for your help
misunderstood this.
I am passing a value to the xslt that i want to use to search in some
nodes. I have the following code for this (note the query parameter):
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput
media-type="text/xml"
method="html"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
encoding="UTF-8"/>
<xslaram name="query"/>
<xsl:template match="/">
<html>
<head>
<title>Search results</title>
</head>
<body>
<h1>Found <xsl:value-of
select="count(/airports/airport/country_name[starts-with(.,$query)])"/>
countries</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Issue is that this doesn't work. If i "hardcode" a string it works. Do
I need to convert it to a string first?
Thank you for your help