calculate number

  • Thread starter =?ISO-8859-1?Q?Frederik_S=F8rensen?=
  • Start date
?

=?ISO-8859-1?Q?Frederik_S=F8rensen?=

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
 
R

Richard Tobin

Frederik Sørensen said:
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?=

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

Frederik
 
M

Malte

Frederik said:
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 ;-)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top