This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl:if and xsl:when
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: xsl:if and xsl:when
- From: "Medina, Edward" <emedina at btg dot com>
- Date: Thu, 30 Mar 2000 11:37:40 -0500
- Reply-To: xsl-list at mulberrytech dot com
>
>
><xsl:when test="contains (@obj.id,'../packet/illust')">
>
>This is testing if the current element has an obj.id that contains that
>string as a substring of the attribute value, so it is true
>on <image obj.id="xxxx../packet/illustyyy'> and false on <image/> I
>suspect that isn't what you want but perhaps it is?
You are right that is not what I wanted but, I just tried
<xsl:when test="contains (@reference,'.../graphics/gif/DSRbanner.gif')">
and it worked. You are the man! my mistake was that I was testing for
something that
was not there.
This is my xml
.... (ommited code)
<illust secur.const="SPECIAL" poc.agency="BTG" poc.orgcode="RAR"
poc.author="Edward Medina"
poc.phone="(813)-288-0333" poc.email="emedina@btg.com"
obj.cutdate="February 22, 2000" obj.id="1"
level="1" >
<image
reference=".../graphics/gif/DSRbanner.gif">
</image>
</illust>
.... (ommited code)
Thank you! I thought I had tried that before, but apparently not. It
works.
I also want to thank all the other people who tried to help me. I've
learned a little
today, and there is room for improvement. Thanks again!
Eddy
-----Original Message-----
From: David Carlisle [mailto:davidc@nag.co.uk]
Sent: Thursday, March 30, 2000 10:58 AM
To: xsl-list@mulberrytech.com
Subject: Re: xsl:if and xsl:when
> I am using the saxon parser to convert to HTML and
> maybe its does not support advance syntax under test. Or maybe its the
> operator (me) that has it wrong.
saxon like any other system has the odd bug, but it is probably the most
complete xsl system there is, so I would guess that it is the operator.
Given no information what the source tree looks like, it's hard to guess
what the queries should be.
but...
<xsl:when test="contains (@obj.id,'../packet/illust')">
This is testing if the current element has an obj.id that contains that
string as a substring of the attribute value, so it is true
on <image obj.id="xxxx../packet/illustyyy'> and false on <image/> I
suspect that isn't what you want but perhaps it is?
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list