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 December 4th, 2007, 03:31 PM
Authorized User
 
Join Date: Dec 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ignoring first element using for-each

I want to traverse all but the first element in a set of elsement using for-each.
How do i skip the first element.

example code below...i want to print all mapping except the first one.It does not depend on the string value.Just that the first mapping element has to be ignored.


<tableData>
<rows>
<row>
<strData>
<mapping>Bucket</mapping>
<alignment>center</alignment>
<stringValue>008/stringValue>
</strData>
<strData>
<mapping>A</mapping>
<alignment>1center</alignment>
<stringValue>BBB</stringValue>
</strData>
<dblData>
<mapping>Loan</mapping>
<alignment>right</alignment>
<values>
<value formatString="#,##0">25.0</value>
</values>
<showZeros>true</showZeros>
</dblData>
</row>
</rows>
<rows>.................</rows>
<rows>.................</rows>
<rows>.................</rows>
</tableData>



 
Old December 4th, 2007, 05:41 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

<xsl:for-each select="(xxxxxxx)[position() != 1]">
  ...
</xsl:for-each>

or in your case

<xsl:for-each select="(strData/mapping)[position() != 1]">
  ...
</xsl:for-each>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ignoring in False clause? gabster XSLT 2 September 7th, 2007 08:29 AM
ignoring/skipping returns (linebreaks) TPP XSLT 2 November 22nd, 2006 02:59 PM
my stylesheet is ignoring nodes gonzalocordero XSLT 8 June 30th, 2006 09:17 PM
Ignoring Namespace Pt2 Chamkaur XSLT 1 June 19th, 2006 05:08 AM
Ignoring nulls in stored proc 12th_Man SQL Language 4 June 17th, 2004 02:11 PM





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