This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XSL document using XPath functions
- From: Sylvie Millette <millettes at smtp dot gc dot ca>
- To: "xsl-list at lists dot mulberrytech dot com" <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 20 Nov 2001 11:21:48 -0500
- Subject: [xsl] XSL document using XPath functions
- Reply-to: xsl-list at lists dot mulberrytech dot com
Good morning,
I am just starting with XML/XSL and would like to use the function
"contains" in an XSL document
here is part of my XSL document:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="uri:xsl">
<xsl:template match="/">
<HTML>
<BODY>
<font color='red'><B>SEARCH RESULT FOR : </B></font>
<xsl:for-each select="individuals/individual">
<xsl:if test="contains(vehicle,'Sunfire')">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD VALIGN="top" COLSPAN="2">
<A><xsl:attribute
name="HREF">'test.html'</xsl:attribute><xsl:value-of
select="@name"/></A>
</TD>
</TR>
</TABLE>
</xsl:if>
</xsl:for-each>
<XML ID="individual" SRC="individuals.xml"></XML>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
I am using IE5 could that be the problem? I have tried to put the
following line
<xsl:stylesheet xmlns:xsl="http://www.w3.org.1999/XSL/Transform"
version="1.0">
instead of:
<xsl:stylesheet xmlns:xsl="uri:xsl">
If I replace the if statement by the following line it works:
<xsl:if test=vehicle[.='123 TRD Pontiac Sunfire 1995 noire'] >
SEE ATTACHED FOR XML DOCUMENT
Do I have to install something special for XPath function to work?
Am I missing a namespace? Is my syntax wrong?
Would really appreciate some help!
Thanks!
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list