Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 10th, 2007, 01:13 PM
Authorized User
 
Join Date: Jul 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default help me with XSLT

Hi

I'm quite new to XSL.

I have some data on an existing XML format:

<Issue>
     <IssueHistory_CreationDate>2004-01-01</IssueHistory_CreationDate>
      <Status>
           <Name>Fined</Name>
                <Amount>28</Amount>
           <Name>Solved</Name>
                <Amount>0</Amount>
            <Name>Finished</Name>
                 <Amount>0</Amount>
   </Status>
    <IssueHistory_CreationDate>2004-01-02</IssueHistory_CreationDate>
    <Status>
           <Name>Fined</Name>
               <Amount>6</Amount>
         <Name>Solved</Name>
               <Amount>6</Amount>
           <Name>Finished</Name>
               <Amount>4</Amount>
   </Status>
    <IssueHistory_CreationDate>2004-01-03</IssueHistory_CreationDate>
    <Status>
           <Name>Fined</Name>
               <Amount>2</Amount>
           <Name>Solved</Name>
               <Amount>6</Amount>
           <Name>Finished</Name>
               <Amount>4</Amount>
   </Status>
   <IssueHistory_CreationDate>2004-01-04</IssueHistory_CreationDate>
    <Status>
           <Name>Fined</Name>
               <Amount>13</Amount>
           <Name>Solved</Name>
               <Amount>7</Amount>
           <Name>Finished</Name>
               <Amount>7</Amount>
  </Status>

Now, I want to transform this into something like this:

<chart>
    <chart_data>
        <row>
            <null/>
            <string>2004-01-01</string>
            <string>2004-01-02</string>
            <string>2004-01-03</string>
            <string>2004-01-04</string>
        </row>
        <row>
            <string>Fined</string>
            <number>28</number>
            <number>6</number>
            <number>2</number>
            <number>13</number>
        </row>
        <row>
                     <string>Solved</string>
            <number>0</number>
            <number>6</number>
            <number>6</number>
            <number>7</number>
        <row>
                    <string>Finished</string>
                    <number>0</number>
            <number>4</number>
            <number>4</number>
            <number>7</number>
        </row>
    </chart_data>
</chart>

Does anyone know how I can translate this with XSLT?

Thanks!

 
Old July 11th, 2007, 12:08 PM
Authorized User
 
Join Date: Dec 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ramesh.kumarm
Default

Hey this seems to be a very basic question...u need to just deal with the xpath to transform it...[with all the tag names u need]

Refer some basic xslt books and u'll get an idea...


Ramesh
"Always Look For Something NEW"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating XSLT with XSLT stonis XSLT 3 April 1st, 2008 08:17 PM
General XSLT Questions in the XSLT Forum jminatel BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 0 March 31st, 2008 07:50 PM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
xslt with an xslt outputfile alleycat XSLT 4 February 20th, 2006 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.