Thomas Patton
Usenet Archive
- Joined
- Aug 10, 2004
- Messages
- 1
- Reaction score
- 0
Hello
I was wandering if anyone could help me with this problem, I have the following xsl file which searches the <description> node of my xml file. This node can contain text with more than one word and white space e.g.
<catalog>
<product>
<item>shoes</item>
<description>white trainers</description>
</product>
</catalog>
At the moment, if I enter "white trainers" or "white trainers leather" in the textfield on my html file, the desired results are output by the xsl file.
I was wandering what code I could use instead of or along with <xsl:if test="contains($text1, description)"> so that if I entered the following queries, the results would also be output by the xsl file:-
white
White
trainers
TRAINERS
white green trainers
and "trainer" if possible, but this query is not really as important as the others.
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl
utput method="html"/>
<xsl
aram name="text1" />
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="/web/files/mystyle.css" /> <title>Results</title> </head>
<body>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<col width="100%" />
<tr>
<th class="fill">Item</th>
</tr>
<xsl:for-each select="catalog/product">
<xsl:if test="contains($text1, description)">
<tr>
<td align="center"><xsl:apply-templates select="./item" /></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
<div align="center">
<a href="/web/index.html">Click here to return to search page</a> </div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I would be very greatful for any help on this.
Thanks
Thomas
I was wandering if anyone could help me with this problem, I have the following xsl file which searches the <description> node of my xml file. This node can contain text with more than one word and white space e.g.
<catalog>
<product>
<item>shoes</item>
<description>white trainers</description>
</product>
</catalog>
At the moment, if I enter "white trainers" or "white trainers leather" in the textfield on my html file, the desired results are output by the xsl file.
I was wandering what code I could use instead of or along with <xsl:if test="contains($text1, description)"> so that if I entered the following queries, the results would also be output by the xsl file:-
white
White
trainers
TRAINERS
white green trainers
and "trainer" if possible, but this query is not really as important as the others.
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl
<xsl
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="/web/files/mystyle.css" /> <title>Results</title> </head>
<body>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<col width="100%" />
<tr>
<th class="fill">Item</th>
</tr>
<xsl:for-each select="catalog/product">
<xsl:if test="contains($text1, description)">
<tr>
<td align="center"><xsl:apply-templates select="./item" /></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
<div align="center">
<a href="/web/index.html">Click here to return to search page</a> </div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I would be very greatful for any help on this.
Thanks
Thomas