xsl-list
[Top] [All Lists]

RE: Re: Conditional Processing in XSLT & JS

2003-01-03 02:42:51
Is there any way how I can compare a node value with a page header
dynamically instead of using java script??

Regards
Frank

-----Original Message-----
From: Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com 
[mailto:Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com]
Sent: Friday, January 03, 2003 10:31 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Re: Conditional Processing in XSLT & JS
Sensitivity: Confidential


Hi,

{name} would return the string value of the child element node where AVT may
appear, but the test attribute of xsl:if is an XPath boolean expression, so
'{name}' in this case evaluates to string "{name}". I suppose you could
write 

  <xsl:if test="string(name) = JAVASCRIPT_GOES_HERE">

if you think it's more clear. Anyhow, your problem is calling JavaScript
from an XSLT stylesheet, which is not XSLT 1.0 - thus, consult the
documentation of your implementation on extensions.

Cheers,

Jarno - Assemblage 23: Anthem

-----Original Message-----
From: ext Frank Psaila [mailto:Frank(_at_)rs2(_dot_)com(_dot_)mt]
Sent: 03 January, 2003 10:53
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Re: Conditional Processing in XSLT & JS
Importance: High
Sensitivity: Confidential


Maybe I have been misunderstood. The part {name} - here I 
mean the test of
node with name 'name' and then I want to bring a string returned by a
javascript function and compare it with the text of the node 
name. If they
match then I will execute the statements beneath the if.

Cheers
Frank

-----Original Message-----
From: Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com 
[mailto:Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com]
Sent: Friday, January 03, 2003 9:46 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Re: Conditional Processing in XSLT & JS
Sensitivity: Confidential


Hi,

I have the following evaluation :

    <xsl:if test="'{name}' = 'return bpr_name()'">  

if the contents of 'name' node and the string returned by the 
javascript
function are equal the it will perform the following tasks.

For some reason or other it is not evaluating the bpr_name function.

Can anybody give me some hint of what maybe is happening??

You're trying to write something that's not XPath. See the 
documentation of
your XSLT implementation how JavaScript is used in XPath 
expressions and use

  <xsl:if test="name = JAVASCRIPT_GOES_HERE"> 

Cheers,

Jarno - Claire Voyant: Premonition (Assemblage 23 Mix)

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list