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 May 11th, 2006, 01:29 PM
Registered User
 
Join Date: May 2006
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





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





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