This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL document using XPath functions
- From: "Carmelo Montanez" <carmelo at nist dot gov>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 20 Nov 2001 14:49:56 -0500
- Subject: Re: [xsl] XSL document using XPath functions
- Organization: NIST
- References: <3BFA831C.E4A000B4@smtp.gc.ca>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi:
I believe the correct namespace is
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
By the way is "vehicle" a child of "individual"?, its
hard to tell you much since we can not see your actual
XML, try and paste part of the XML file. I believe the
list strips any attachements.
Greetings,
Carmelo Montanez
----- Original Message -----
From: "Sylvie Millette" <millettes@smtp.gc.ca>
To: <xsl-list@lists.mulberrytech.com>
Sent: Tuesday, November 20, 2001 11:21 AM
Subject: [xsl] XSL document using XPath functions
> 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
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list