calculate number

Discussion in 'XML' started by =?ISO-8859-1?Q?Frederik_S=F8rensen?=, Feb 7, 2005.

  1. I'm trying to do this calculation in xsl but i get an error message:
    "expression is not a node set"

    <xsl:variable name="height" select="round(130/width*height)+10"/>

    How do i save the result from this calculation in my variable?

    height and width im my xml contains the height and width of an image.

    Frederik
    =?ISO-8859-1?Q?Frederik_S=F8rensen?=, Feb 7, 2005
    #1
    1. Advertising

  2. In article <420768ea$0$627$>,
    Frederik Sørensen <> wrote:

    >I'm trying to do this calculation in xsl but i get an error message:
    >"expression is not a node set"
    >
    ><xsl:variable name="height" select="round(130/width*height)+10"/>


    The division operator is "div", not "/".

    The error message reflects the fact that you are trying to find the
    <width> children of 130.

    -- Richard
    Richard Tobin, Feb 7, 2005
    #2
    1. Advertising

  3. Works like a charm :)
    Thanks for the very fast reply.

    Frederik

    Richard Tobin wrote:
    > In article <420768ea$0$627$>,
    > Frederik Sørensen <> wrote:
    >
    >
    >>I'm trying to do this calculation in xsl but i get an error message:
    >>"expression is not a node set"
    >>
    >><xsl:variable name="height" select="round(130/width*height)+10"/>

    >
    >
    > The division operator is "div", not "/".
    >
    > The error message reflects the fact that you are trying to find the
    > <width> children of 130.
    >
    > -- Richard
    =?ISO-8859-1?Q?Frederik_S=F8rensen?=, Feb 7, 2005
    #3
  4. =?ISO-8859-1?Q?Frederik_S=F8rensen?=

    Malte Guest

    Frederik Sørensen wrote:
    >
    > I'm trying to do this calculation in xsl but i get an error message:
    > "expression is not a node set"
    >
    > <xsl:variable name="height" select="round(130/width*height)+10"/>
    >
    > How do i save the result from this calculation in my variable?
    >
    > height and width im my xml contains the height and width of an image.
    >
    > Frederik


    From a current project:

    <xsl:value-of select="format-number(translate(((($upris - $ipris) * 100)
    div $upris),',','.'), '#.##0,0', 'european' )"/>

    As you can see, your variable best sport a '$' or they're not variables ;-)
    Malte, Feb 7, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mark
    Replies:
    3
    Views:
    376
    Marcin Kalicinski
    Jun 14, 2004
  2. Herrcho
    Replies:
    6
    Views:
    443
    Peter Pichler
    Feb 20, 2004
  3. P. Schmidt-Volkmar
    Replies:
    7
    Views:
    338
    Bengt Richter
    Dec 21, 2005
  4. Steve Kershaw
    Replies:
    0
    Views:
    415
    Steve Kershaw
    Nov 22, 2006
  5. Anjum
    Replies:
    3
    Views:
    702
Loading...

Share This Page