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

Re: Using xsl:iterate inside <xsl:for-each-group> xslt

Subject: Re: Using xsl:iterate inside <xsl:for-each-group> xslt 3.0
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Aug 2020 15:18:25 -0000
Re:  Using xsl:iterate inside <xsl:for-each-group> xslt
Am 18.08.2020 um 16:09 schrieb Terry Ofner tdofner@xxxxxxxxx:
Is it possible to reference elements in p[@class=bnlb] (to the left of
the ! $groups) in the iterate? Or to pass a parameter including the item
number of the p[@class=bnlb] to the iterate. The selected node of the
iterate is <p=class=bDirectionsb>.


<xsl:template match="set[p[@class = 'nl']]">


B B B <xsl:variable name="groups" as="map(xs:string, element())*">
B B B B B <xsl:for-each-group select="p[@class = 'directions']/*"
group-starting-with="span[@class = 'letter']">
B B B B B B B <xsl:sequence select="map { 'letter' : ., 'term' :
current-group()[2] }"/>
B B B B B </xsl:for-each-group>
B B B </xsl:variable>


B B B <write_choices>
B B B B B <xsl:iterate select="p[@class = 'nl'] ! $groups">

If you need the item on the left side of ! then include it in a merged group, for instance

       <xsl:iterate select="p[@class = 'nl'] ! map:merge(($groups, map
{ 'p' : . }))">

then the expression ?p inside the iterate selects the property named "p"
of the map which holds the "p" element.

The map functions are in the namespace
http://www.w3.org/2005/xpath-functions/map so you need to declare e.g.
xmlns:map="http://www.w3.org/2005/xpath-functions/map" in your
stylesheet to use map:merge.

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.