Re: calling vb functions in xsl

Subject: Re: calling vb functions in xsl
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 9 Nov 2000 21:46:38 -0800 (PST)
Hi Jenni,

> You are actually setting it to a node: the language element that's a
> child of the page document element.  So the value that you pass into
> the VBScript function is a node, whereas it's expecting a string,
> which is why you get the problem.

You're essentially right, with the exception that the passed value is
not a node, but it is a nodeset.

This nodeset may contain not just one node, but 0 or >=2 nodes.

> Instead, either change the select expression of the variable to give
it a string value:
>
> <xsl:variable name="currentLanguage"
>              select="string(/page/language)" />

Therefore, 
string(/page/language) 

is the same as 

string(/page/language[1])

, which may not be what the author intended.


Cheers,
Dimitre Novatchev.


----------------- Original message -------------
Date: Thu, 9 Nov 2000 10:08:39 +0000
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Subject: Re: calling vb functions in xsl

Mark,

> This syntax works fine when using a string for a parameter, but not 
when I
> attempt to pass in the xsl variable that I'm using throughout my XSL.

When you set your variable:

> <xsl:variable name="currentLanguage" select="/page/language" />

You are actually setting it to a node: the language element that's a
child of the page document element.  So the value that you pass into
the VBScript function is a node, whereas it's expecting a string,
which is why you get the problem.

Instead, either change the select expression of the variable to give
it a string value:

<xsl:variable name="currentLanguage"
              select="string(/page/language)" />

or make sure you pass a string when you call the function:

  <xsl:value-of
    select="ms:GetLanguageFormattedDate(string($currentLanguage))" />

I hope that helps,

Jeni

- ---
Jeni Tennison
http://www.jenitennison.com/




__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/


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


Current Thread