[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: count hits/matches - INCREMENT

Subject: RE: count hits/matches - INCREMENT
From: Dariusz Borowski <d.borowski@xxxxxx>
Date: Mon, 20 Jun 2005 16:51:24 +0200
dariusz borowski
...Sorry, here is the xml-result I have from parsing the xsl-file:

=======================================

- <chart:seriesgroup series="revision">
  <chart:category-item value="2" category="2005-07" />
  <chart:category-item value="1" category="2005-07" />
  <chart:category-item value="1" category="2005-06" />
  <chart:category-item value="1" category="2005-05" />
  </chart:seriesgroup>

=======================================

Regards,
Dariusz





xsl-list@xxxxxxxxxxxxxxxxxxxxxx schrieb am 20.06.05 16:48:44:
>
>
> Thanks for the good advises.
>
> Maybe I should explain much better, what  I try to do....
>
> xml-file:
> =====================
> <revision-list>
>
> - <revision>
>
>   <revision-id>1</revision-id>
>
>   <revision-date>2005-05-03</revision-date>
>
>   <revision-description>Initial (first) Revision of D&D
Plan</revision-description>
>
>   </revision>
>
> - <revision>
>
>   <revision-id>2</revision-id>
>
>   <revision-date>2005-06-03</revision-date>
>
>   <revision-description>Second Issue of D&D Plan</revision-description>
>
>
>
>   </revision>
>
> - <revision>
>
>   <revision-id>3</revision-id>
>
>   <revision-date>2005-07-03</revision-date>
>
>   <revision-description>Third Issue of D&D Plan</revision-description>
>
>
>   </revision>
>
> - <revision>
>
>   <revision-id>6</revision-id>
>
>   <revision-date>2005-07-03</revision-date>
>
>   <revision-description>Fourth Issue</revision-description>
>
>   <error>There isn't any plans listed!</error>
>
>   </revision>
>
>   </revision-list>
>
> ============================
>
> Now, over XSL I try to filter all that. For example the result should look
like this:
>
> ============================
>
> - <chart:seriesgroup series="revision">
>   <chart:category-item value="2" category="2005-07" />
>   <chart:category-item value="1" category="2005-06" />
>   <chart:category-item value="1" category="2005-05" />
>   </chart:seriesgroup>
>
> ============================
>
> In this xml-file I got 2 hits for the date: 2005-07.
>
> The result what I have is:
>
> ============================
>
> And here is my for-loop in the xsl-file:
> ===========================
> <!-- get all revision-dates -->
> 			<xsl:for-each select="revision-list/revision">
> 			<!-- sort the dates -->
> 			<xsl:sort order="descending" select="revision-date" />
>
> 				<xsl:variable name="time">
> 				<!-- get all, NOT duplicate values -->
> 				<!-- <xsl:value-of
select="revision-date[not(.=following::revision-date)]" /> -->
> 				<xsl:value-of
select="revision-date[not(.=following-sibling::revision-date)]" />
> 				</xsl:variable>
>
> 				<xsl:variable name="val">
> 					<xsl:value-of
select="count(revision-date[.=following::revision-date])+1" />
> 				</xsl:variable>
>
>
>
> 				<!-- get just the first 7 chars for the variable $time -->
> 				<xsl:variable name="date" select="substring($time, 1, 7)" />
>
>
> 				<!-- <xsl:if test="$time != ''"> -->
> 					<chart:category-item category="{$date}" value="{$val}" />
> 				<!-- </xsl:if> -->
>
>
>
>
>
> 			</xsl:for-each>
>
> ===================================
>
> Can anybody help me?
>
> Thanks!
> Dariusz
>
>
>
>
> xsl-list@xxxxxxxxxxxxxxxxxxxxxx schrieb am 20.06.05 15:36:46:
> >
> > >
> > > My Question is, how to count hits.
> >
> > count($elements[condition])
> >
> > >
> > > Is it possible in XSL to change the value of a variable in a
> > > <xls:for-each> and get the value after the <xsl:for-each>?
> > >
> >
> > No. XSLT is a functional language, not a procedural one.
> >
> > Michael Kay
> > http://www.saxonica.com/
> >
>
>
> _________________________________________________________________________
> Mit der Gruppen-SMS von WEB.DE FreeMail kvnnen Sie eine SMS an alle
> Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179
>


_________________________________________________________________________
Mit der Gruppen-SMS von WEB.DE FreeMail kvnnen Sie eine SMS an alle
Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.