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

Re: Grouping but not starting at the first element.

Subject: Re: Grouping but not starting at the first element.
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 Oct 2012 13:52:02 -0400
Re:  Grouping but not starting at the first element.
At 2012-10-02 15:58 +0000, Kerry, Richard wrote:
My input XML is shown below. It represents part of an Excel spreadsheet, hence the references to rows and columns.
...
<xsl:for-each-group select="row" group-starting-with="row[column[1][. != '']]" >
So I'm grouping based on starting with rows with column[1] not empty.


The result I get is :
<?xml version="1.0" encoding="UTF-8"?>
<page>
<item name="AT3G_UP_DN" row="1"/>
<item name="name" row="2">
<sub-item caption="caption" value="value"/>
</item>
<item name="Card fail" row="3">
<sub-item caption="Card Fail" value="0"/>
<sub-item caption="Card OK" value="1"/>
</item>
<item name="SD-SD ARC bypass" row="6">
<sub-item caption="Normal" value="0"/>
<sub-item caption="Bypass" value="1"/>
</item>
</page>

I understand why I get this. What I'd like to do is get rid of the items generated by rows 1 and 2.

Then don't include those rows when you are specifying the population to be grouped.


Can anyone advise how to go about achieving this ?

<xsl:for-each-group select="row[position()>2]" ...


I hope this helps.

. . . . . . . . . . Ken

--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

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.