This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: when test
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: when test
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Fri, 8 Sep 2000 15:48:29 +0100
- Reply-To: xsl-list at mulberrytech dot com
Eric,
Dunno what has happened to this thread but it is all over the place. I
posted this earlier.
Eric,
Try
<xsl:when language="JavaScript"
expr="getDirectory(this.getAttribute('page')) != ''">
language="JavaScript" isn't really needed as it defaults to ECMA 262
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
>-----Original Message-----
>From: owner-xsl-list@mulberrytech.com
>[mailto:owner-xsl-list@mulberrytech.com]On Behalf Of Eric Taylor
>Sent: 08 September 2000 14:09
>To: 'Mike Gargiullo'
>Cc: 'XSL-List@mulberrytech.com'
>Subject: RE: when test
>
>
>Hi Mike. Appreciate the response. Your solution would work great if the
>answer existed in my XML data, but my problem on this one is that I need to
>do the test on what the getdirectory script returns rather than on anything
>in my current file, that is, the equivalent of:
><xsl:when
>test="not(<xsl:eval>getDirectory(this.getAttribute('page'))</xsl:eval>)">
>only I know I can't do it like that. I thought of putting the value the
>script into a variable and testing that, but MSXML2 (which is what
>I'm stuck
>with for the moment with IE5) doesn't support xsl:variable (see
>http://www.vbxml.com/xsl/XSLTRef.asp <http://www.vbxml.com/xsl/XSLTRef.asp>
>), so I don't think I can do that. Anyone have further thoughts?
>
>From: Mike Gargiullo [mailto:mgargiullo@smallworld.com]
>
> <xsl:when test="not(sometag='')">
> will be true if "sometag" contains data (sometag is from your xml
>structure, can be at any level)
>
>
>***************************
>----Original Message-----
>From: Eric Taylor [ mailto:Eric.Taylor@RealPage.com
><mailto:Eric.Taylor@RealPage.com> ]
>
>
> Part of my XSL looks like this:
>
> <xsl:choose>
> <xsl:when *** stuck here ***>
> <A>
> <xsl:attribute
>name="href"><xsl:eval>getDirectory(this.getAttribute('page'))</xsl:
>eval></xs
>
>l:attribute>
> <xsl:attribute name="target">new_window</xsl:attribute>
> <xsl:value-of select="@text"/>
> </A>
> </xsl:when>
> <xsl:otherwise>
> <xsl:value-of select="@text"/>
> </xsl:otherwise>
> </xsl:choose>
>
>I only want the "when" to happen if
><xsl:eval>getDirectory(this.getAttribute('page'))</xsl:eval> returns some
>value (that is, if it returns a blank value, I want to do the
>"otherwise").
>I don't know the syntax for this. Thanks. Eric
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list