DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: please help

  1. #1
    Join Date
    Nov 2010
    Posts
    4

    please help

    Hi guys

    Im really new to xml, Im doing an assigment that my teacher gave me but I dont know how to tackle it. I have a xml file like this
    Code:
     <?xml version="1.0" encoding="utf-8" ?> 
    - <NewDataSet>
    - <PremierOrdersCustomerOrders>
      <CustomerID>2000</CustomerID> 
      <CustomerNo>SA124</CustomerNo> 
      <FirstName>Sally</FirstName> 
      <Surname>Adams</Surname> 
      <OrderNumber>12000</OrderNumber> 
      <PartNumber>AX12</PartNumber> 
      <Description>Iron</Description> 
      <NoOrdered>1</NoOrdered> 
      <QuotedPrice>24.95</QuotedPrice> 
      <SalesRepNo>WS102</SalesRepNo> 
      <CustomerNo1>SA124</CustomerNo1> 
      </PremierOrdersCustomerOrders>
    - <PremierOrdersCustomerOrders>
      <CustomerID>2000</CustomerID> 
      <CustomerNo>SA124</CustomerNo> 
      <FirstName>Sally</FirstName> 
      <Surname>Adams</Surname> 
      <OrderNumber>12000</OrderNumber> 
      <PartNumber>BH22</PartNumber> 
      <Description>Toaster</Description> 
      <NoOrdered>1</NoOrdered> 
      <QuotedPrice>109.89</QuotedPrice> 
      <SalesRepNo>WS102</SalesRepNo> 
      <CustomerNo1>SA124</CustomerNo1> 
      </PremierOrdersCustomerOrders>
    ...
    He asks me to create a html display sum of totalamount base on customerID using xsl. I tried to use sum() but it would not work. Could someone please help me what should I use to do this question? or some advice would be awsome

    Thank alot

  2. #2
    Join Date
    Nov 2010
    Posts
    4
    oops sorry it was sum of QuotedPrice instead of totalamount so the question was asking for total of all QuotedPrice from a specific customerID

  3. #3
    Join Date
    Nov 2010
    Posts
    4
    hi guys i found the solution after spending somtime searching on google, the reason I could not use sum() is because of tree fragment or somthing like that. To get around it just need to use node-set function... anyway thank for have a look at this thread

    have a look below page for more infor if u interest in the solution
    http://www.xml.com/pub/a/2003/07/16/nodeset.html

  4. #4
    Join Date
    May 2009
    Location
    United Kingdom
    Posts
    49
    I think you should start by reading these:
    http://www.w3schools.com/xpath/
    http://www.w3schools.com/xsl/

    W3Schools is very good for learning the basics of a subject.

    When I was a uni one of my lecturers used the W3Schools site for a workshop resource.

    If you've still got any issues after reading these then feel free to post something more specific with some code examples for your XSL.

  5. #5
    Join Date
    Nov 2010
    Posts
    4
    thx for reply and advice i have found the solution it has something to do with node-set() function, got the code after do some reading

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center