Re: [xsl] Process the following group

Subject: Re: [xsl] Process the following group
From: "Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Jul 2022 20:20:11 -0000
Normally you shouldnbt need to process a preceding group in the context of
processing a current groupbthat suggests a procedural way of thinking about
the problem. Or else you can just use normal XPath to select things from
preceding nodes starting with the nodes in the current group.

However, it may be that what you need is a multiple-phase process, where you
do grouping to create a hierarchical structure and then apply additional
processing to that so you can now use normal XPath selection of things in
preceding groups, i.e.:

<xsl:variable select=bgroupedb as=belement()*b>
  <grouped xml:base=b{base-uri(.)}b>
   <!bdo grouping here b"
  </grouped>
</xsl:variable>
<xsl:apply-templates select=b$groupedb
mode=bdo-something-with-groupsb/>

Note that I added @xml:base to the element that contains the grouped result so
that any relative URI resolution applied to the grouped elements will have the
correct base URI.

Cheers,

E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> |
Twitter<https://twitter.com/servicenow> |
YouTube<https://www.youtube.com/user/servicenowinc> |
Facebook<https://www.facebook.com/servicenow>

From: Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thursday, July 7, 2022 at 3:11 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [xsl] Process the following group
[External Email]



On 07.07.2022 21:59, rick@xxxxxxxxxxxxxx<mailto:rick@xxxxxxxxxxxxxx> wrote:



I need to do more study on grouping. I wonder if given a certain group, can
you process the preceding group if you want to?



If you store groups first e.g. in a sequence of arrays or an array of arrays,
then I think you can do that.
XSL-List info and
archive<https://urldefense.com/v3/__http:/www.mulberrytech.com/xsl/xsl-list__
;!!N4vogdjhuJM!EIKmg7GWTh1yHrVfbm7jsfdhlCDLup6l5s5lbhXOQvsqIr4Ds7gbREPZT-qd0Y
LAh0omDjYi-1xfoIs2EKdC3TjF4myfruenS1eD8T39cOg$>
EasyUnsubscribe<https://urldefense.com/v3/__http:/lists.mulberrytech.com/unsu
b/xsl-list/3453418__;!!N4vogdjhuJM!EIKmg7GWTh1yHrVfbm7jsfdhlCDLup6l5s5lbhXOQv
sqIr4Ds7gbREPZT-qd0YLAh0omDjYi-1xfoIs2EKdC3TjF4myfruenS1eDNBJdOS4$> (by
email<>)

Current Thread