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

RE: Counting nodes processed

Subject: RE: Counting nodes processed
From: JAY SCHERER <jay.scherer@xxxxxxxxxx>
Date: Tue, 5 Mar 2002 13:27:10 -0600
RE:  Counting nodes processed
Joerg,

Hmmm... seemed to print out all topics for a category.  Any hints?  Changed it to lt; 1 and it still printed out all topics for a category

Jay

-----Original Message-----
From: Joerg Heinicke [mailto:joerg.heinicke@xxxxxx]
Sent: Tuesday, March 05, 2002 1:11 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Counting nodes processed


<xsl:template match="TopicOwner">
    <xsl:apply-templates select="Category"/>
</xsl:template>

<xsl:template match="Category">
    <xsl:value-of select="@name"/>
    <xsl:apply-templates
select="Topic[count(../preceding-sibling::Category/Topic) &lt; 5]"/>
</xsl:template>

<xsl:template match="Topic">
    <xsl:value-of select="@name"/>
</xsl:template>

Regards,

Joerg

> All,
>
> thanks for the help yesterday.  However, as I was working on this problem
I realized that my xml description was slightly different.  There's a new
twist.  The xml description is now similar to the following:
>
> <Root>
>   <TopicOwner id="1" name="owner1">
>      <Category id ="1" name="Sports">
>         <Topic id="1" name="Basketball"/>
>         <Topic id="2" name="Football"/>
>         <Topic id="3" name="Baseball"/>
>      </Category>
>      <Category id="2" name="FooCategory">
>         <Topic id="4" name="FooTopic"/>
>      </Category>
>   </TopicOwner>
>   <TopicOwner id="2" name="owner2">
>     <Category id="2" name="Entertainment">
>         <Topic id="4" name="Puzzles"/>
>         <Topic id="5" name="Games"/>
>     </Category>
>   </TopicOwner>
> </Root>
>
> Each owner may have > 1 category and each category has > 1 topic.  The
problem is still the same.  I want to retrieve only X number of topics for
each owner.  So, assuming I want to retrieve 4 topics per owner, the output
should be
>
> Owner1
>   Sports
>      Basketball
>      Football
>      Baseball
>   FooCategory
>      FooTopic
>
> Owner2
>   Entertainment
>      Puzzles
>      Games
>
> Thanks,
> jay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.