xsl-list
[Top] [All Lists]

RE: Conditional branching on string attribute in IE5?

2002-12-30 16:40:32
I left something out. You forgot to close the "info" element, so you will have 
to alter your source document to add a slash (/) before the right angle bracket 
to get well-formed XML.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     drsystems(_at_)vsnl(_dot_)net
Sent:     Mon, 30 Dec 2002 08:13:59 +0500 (IST)
To:       XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  [xsl] Conditional branching on string attribute in IE5?

Hi,

This is for IE5. For an XML file like:
<xml>
 <info path="abc.txt">
 <info path="abc.jpg">
</xml>
  
I want to check the value of xml/info/path,
and if it contains a .jpg or .gif extension, 
generate an img node, else generate an
href node.

I tried the following:
.
<xsl:for-each select="xml/info">
 <xsl-if test="contains(@path,'.jpg')">
   <xsl-element name="a">
    ..
and got an error, "Unknown method contains(@".

What is the right way to do this for IE5?
Upgrade to IE6 is not an option :-(
This is urgent, and I am stuck at this.
Please help out a new XSL enthusiast! :)

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