xsl-list
[Top] [All Lists]

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

2020-08-18 09:08:47
Is it possible to reference elements in p[@class=‘nl’] (to the left of the ! 
$groups) in the iterate? Or to pass a parameter including the item number of 
the p[@class=’nl’] to the iterate. The selected node of the iterate is 
<p=class=‘Directions’>.

On Aug 13, 2020, at 3:55 PM, Martin Honnen 
martin(_dot_)honnen(_at_)gmx(_dot_)de 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

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


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


   <write_choices>
     <xsl:iterate select="p[@class = 'nl'] ! $groups">
       <write_choice num="{position() - 1}" letter="{?letter}"
term="{?term}"/>
     </xsl:iterate>
   </write_choices>
 </xsl:template>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>