[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|