This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XSL document using XPath functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]