Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 11th, 2006, 01:29 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to daula7
Default Please help, xml transforming using xslt !!!

Hello everyone;
I have an xml that looks like the following:

---snip---

<dts>
<output>
<total name="test_t">
  <total name="cState">
    <total name="date_range">
      <value >00-06 </value>
      <count>21</count>
    </total>
    <total name="date_range">
      <value >07-12 </value>
      <count>26</count>
    </total>
    <total name="date_range">
      <value>13-24 </value>
      <count>34</count>
    </total>
    <value>AK</value>
    <count>81</count>
  </total>
  <total name="cState">
    <total name="date_range">
      <value >00-06 </value>
      <count>50</count>
    </total>
    <total name="date_range">
      <value >07-12 </value>
      <count>10</count>
    </total>
    <total name="date_range">
      <value>13-24 </value>
      <count>40</count>
    </total>
    <value>AR</value>
    <count>100</count>
  </total>
  .
  .
  .
</total>
</output>
</dts>

---snip---

my xslt follows:
-----------------
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
   <xsl:template match="/" >

   <xsl:text> _Total_ </xsl:text>
     <xsl:for-each select=
       "dts/output/total/total/total[generate-id(.)
       =generate-id(key('range',value))]">

       <xsl:value-of select="value"/>
       <xsl:text>: </xsl:text>
       <xsl:for-each select="key('range',value)">
          <xsl:value-of select="sum(count)"/>
          <xsl:text >,</xsl:text>
       </xsl:for-each>
     </xsl:for-each>

   </xsl:template>
</xsl:stylesheet>

----

I'm seeeking more help in using xslt for transformation/ retrieve data such that, to display the sum of "count" by "date_range" for all states.
For instance:

_Totals_
00-06 : 71
07-12 : 36

et cetera...

However, when I try to diplay the output... I'm getting a blank screen. I desperately need your help.
Please, note that I'm using xslt 1.0

Thanks in advance for your kind assistance

daula
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show CURRENT DATE when transforming XML using XSLT richieWolf XSLT 0 October 20th, 2007 07:47 PM
Exception when transforming using XSLT ksskumar XSLT 5 October 10th, 2006 06:20 AM
problem transforming XML using xslt micky3248 XSLT 7 August 18th, 2006 03:52 AM
Transforming XML data in an ASP file using XSLT hussainm Classic ASP XML 0 May 31st, 2006 03:21 PM
Transforming a result tree with yet another Xslt ballo XSLT 2 March 7th, 2006 09:42 AM



All times are GMT -4. The time now is 02:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.