[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
Wow. That is certainly efficient. I can see that I have some catching up to do. I am not familiar with as=map() and the call of it. I am looking now at the version using iterate. So, the sequence inside $groups looks something like this: bletterb : <span class=bletterb>S</span> : btermb : <span class=btermb>sentence</span> Similar in construction to JSON? I am also unfamiliar with the use of the exclamation point in <xsl:iterate select="p[@class = 'nl'] ! $groupsb> Similarly, the question mark in the population of the attributes is new to me" letter="{?letter}b. I get a vague sense of how this works. More reading is in store. For sure. Thanks. > On Aug 13, 2020, at 3:55 PM, Martin Honnen martin.honnen@xxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|