[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] Re: Extension Function Problem

Subject: [list4xt] Re: Extension Function Problem
From: Eric van der Vlist (vdv@dyomedea.com)
Date: 27/04/2001 - 08:02


Linus-Lin wrote:
>
> My xsl ran nicely with literals such as:
>
> <xsl:when test="function-available('phrase:get-height') and
> function-available('phrase:new')">
> <xsl:variable name="object" select="phrase:new()"/>
> <xsl:value-of
> select="string(phrase:get-height($object,'serif','normal','normal','24','thi
> s is text'))"/>
> </xsl:when>
>
> put threw an illegal argument error with this:
>
> <xsl:when test="function-available('phrase:get-width') and
> function-available('phrase:new')">
> <xsl:variable name="object" select="phrase:new()"/>
> <xsl:value-of
> select="string(phrase:get-width($object,$fontfamily,$fontstyle,$fontweight,$
> fontsize,$value))"/>
> </xsl:when>
>
> Is this due to a scope problem???

I would rather bet on a problem with the datatypes (XT is very strict
and doesn't do any implicit binding).

If, for instance, you declare

<xsl:variable name="fontfamily">serif</xsl:variable>

$fontfamily will be of type result tree fragment, and not string as
seems to be expected by your function.

To avoid this, you can either make sure that your variable is a string:

<xsl:variable name="fontfamily" select="'serif'"/>

or

<xsl:variable name="fontfamily" select="string(...)"/>

or do an explicit binding:

 <xsl:value-of
   select="string(phrase:get-width($object,string($fontfamily)
   ...

Hope this helps,

Eric

> How should I fix this???
>
> Thanks in advance.
>
> Linus
>
> --

-- 
See you in Hong Kong for www10:
                     http://www.www10.org/program/w10-half-tut.shtml#ta5
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://refurbishedcreditcardterminals.com
http://psbill.com -           http://ebiz-consulting.com           http://gonciarzlaw.com
------------------------------------------------------------------------

-- Mailing list for the XT users community. (http://webzinearticles.com) (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 01/06/2001 - 09:01 CEST

webmaster@4xt.org


A site designed by Dyomedea