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

Re: Starting loop at another node

Subject: Re: Starting loop at another node
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 17 Apr 2001 12:28:29 +0100
Re:  Starting loop at another node
Tanz:

At 04:33 PM 4/17/01, you wrote:
I am trying to start the loop at node 4 (child 4) of the 'whatever' parent:
<Whatever> <child1>
           <child2>
           <child3>
           <child4>
           <child5>
           <child6>
               ....
</Whatever>

I am using the following

 <xsl:for-each select="Whatever">
           <xsl:choose>
           <xsl:when test="position()&gt;3"> <!-- Here is the problem -->
         <xsl:for-each select="*[text()]"> <!--start of process-->
          <h3><font color="#00007f"><i><xsl:value-of
select="name()"/></i></font></h3>
           <p><font color="#008000"><xsl:value-of select="."/></font></p>
           </xsl:for-each> <!--end of process-->
                </xsl:when>
         </xsl:choose>
         </xsl:for-each>

At the moment the display is not doing as I wish.

<xsl:for-each select="Whatever/child[position() &gt; 3]"> is more succinct and would get you the nodes you want. No inner choose/when or for-each is necessary.


Your problem is happening because your xsl:when is evaluating the position of the Whatever node, not its children.

Regards,
Wendell

Thanks.

Tanz




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

====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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.