Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

XML-XSL calculation

XML-XSL calculation

XML-XSL calculation

Hello everybody! Id like some help,i dont know how to calculate the total prize and the total items sold.There are 10 prizes and 10 items to be calculated.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlnssl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<table border="1">
<tr bgcolor="#9acd32">
<th>Telephone number</th>
<xsl:for-each select="Customers/Customer">
<td><xsl:value-of select="Name"/></td>
<td><xsl:value-of select="Address"/></td>
<td><xsl:value-of select="Telephone_number"/></td>
<td><xsl:value-of select="Ordered_item"/></td>
<td><xsl:value-of select="start"/></td>
<td><xsl:value-of select="prize"/></td>


I used that format:
<xsl:value-of select="//prize[1]"/>
<xsl:text> + </xsl:text>
<xsl:value-of select="//prize[2]"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="//prize[1] + //prize[2]"/>

till "//prize[10]" but it only displays : 400+=NaN

The XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Name>John </Name>
<Address>19 Holloway Road </Address>
<Telephone_number>07827384928 </Telephone_number>
<Ordered_item>Sofa </Ordered_item>

<Address>30 Holloway Road </Address>
<Telephone_number>09382930492 </Telephone_number>

<Address>13 Holloway Road </Address>
<Telephone_number>07823049828 </Telephone_number>
<Ordered_item>Bedside Cabinet </Ordered_item>

<Address>92 Holloway Road </Address>
<Ordered_item>Sofa </Ordered_item>

<Name>Chris </Name>
<Address>123 Holloway Road </Address>
<Telephone_number>072839402912 </Telephone_number>
<Ordered_item>Mattresses </Ordered_item>

<Address>87 Holloway Road </Address>
<Telephone_number>072839402945 </Telephone_number>
<Ordered_item>Table </Ordered_item>

<Name>Jake </Name>
<Address>72 Holloway Road </Address>
<Telephone_number>07263849271 </Telephone_number>
<Ordered_item>Bedside Cabinets </Ordered_item>

<Name>Amy </Name>
<Address>69 Holloway Road </Address>
<Telephone_number>07877306301 </Telephone_number>
<Ordered_item>Table </Ordered_item>

<Address>90 Holloway Road </Address>
<Telephone_number>0772732348 </Telephone_number>
<Ordered_item>Mattresses </Ordered_item>

<Name>Ryann </Name>
<Address>174 Holloway Road </Address>
<Ordered_item>Sofa </Ordered_item>


Thank you in advance!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close