Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stylesheet problem <------------ question freak

Status
Not open for further replies.

Endbringer

Technical User
Jan 18, 2002
28
0
0
US
I've got a stylesheet that it isn't quite working right. here it is.

<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?>
<xsl:stylesheet xmlns:xsl=&quot; version=&quot;1.0&quot;>
<xsl:param name=&quot;projectName&quot;>Default value</xsl:param>
<xsl:eek:utput method=&quot;html&quot; indent=&quot;yes&quot; omit-xml-declaration=&quot;yes&quot;/>

<xsl:template match=&quot;/&quot;>

<html xmlns=&quot;
<head>
<title>Engineering Archive</title>
</head>

<body>
<table border=&quot;1&quot;>
<tr><td width=&quot;400&quot; height=&quot;*&quot;>
You searched for: <b><xsl:value-of select=&quot;$projectName&quot;/></b>

</td></tr>
<tr><td width=&quot;400&quot; height=&quot;*&quot;>
<xsl:apply-templates />
</td></tr>
</table>

</body>
</html>
</xsl:template>

<xsl:template match=&quot;name&quot;>
<xsl:for-each select=&quot;//name&quot;>
<xsl:variable name=&quot;projName&quot;>
<xsl:value-of select=&quot;.&quot; />
</xsl:variable>
<xsl:choose>
<xsl:when test=&quot;contains($projName,$projectName)&quot;>
<xsl:value-of select=&quot;.&quot; />
</xsl:when>
<xsl:eek:therwise>
There were no matches.
</xsl:eek:therwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

If $projectName is contained under //name, i want it to return just those nodes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top