Endbringer
Technical User
I've got a stylesheet that it isn't quite working right. here it is.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl
aram name="projectName">Default value</xsl
aram>
<xsl
utput method="html" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<html xmlns="
<head>
<title>Engineering Archive</title>
</head>
<body>
<table border="1">
<tr><td width="400" height="*">
You searched for: <b><xsl:value-of select="$projectName"/></b>
</td></tr>
<tr><td width="400" height="*">
<xsl:apply-templates />
</td></tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="name">
<xsl:for-each select="//name">
<xsl:variable name="projName">
<xsl:value-of select="." />
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($projName,$projectName)">
<xsl:value-of select="." />
</xsl:when>
<xsl
therwise>
There were no matches.
</xsl
therwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
If $projectName is contained under //name, i want it to return just those nodes.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xsl
<xsl
<xsl:template match="/">
<html xmlns="
<head>
<title>Engineering Archive</title>
</head>
<body>
<table border="1">
<tr><td width="400" height="*">
You searched for: <b><xsl:value-of select="$projectName"/></b>
</td></tr>
<tr><td width="400" height="*">
<xsl:apply-templates />
</td></tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="name">
<xsl:for-each select="//name">
<xsl:variable name="projName">
<xsl:value-of select="." />
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($projName,$projectName)">
<xsl:value-of select="." />
</xsl:when>
<xsl
There were no matches.
</xsl
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
If $projectName is contained under //name, i want it to return just those nodes.