[xsl] Re: how can I make non-tunnelling parameters tunnel through <xsl:next-match/>?

Subject: [xsl] Re: how can I make non-tunnelling parameters tunnel through <xsl:next-match/>?
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 1 Jul 2022 23:04:31 -0000
Hi everyone,

In looking for a workaround, I found a better solution!

Before I knew about <xsl:next-match> and the preprocessing approach, I used to
copy the DITA-OT's templates and modify them. With that approach, I tried to
identify the lowest-level template to copy and modify. In my previous post,
"A" and "B" were part of that lower-level DITA-OT machinery.

But with an <xsl:next-match> post-processing approach, I realized that I can
wedge into processing at a higher level and let the shallow-copy moded
templates match deeper inside the content where needed. In this case, it's
nice and clean to match at <note> element itself:


<xsl:template match="*[contains-token(@class, 'topic/note')]">
  <xsl:variable name="results">
    <xsl:next-match/>
  </xsl:variable>
  <xsl:apply-templates select="$results" mode="my-note-postprocessing"/>
</xsl:template>

<xsl:mode name="my-note-postprocessing" on-no-match="shallow-copy"/>

<xsl:template match="..." mode="my-note-postprocessing">
  ...
</xsl:template>


I'm still curious if there is an answer to my original question, but I no
longer need the answer for my final implementation.

-----
Chris Papademetrious
Tech Writer, Implementation Group
(610) 628-9718 home office
(570) 460-6078 cell

Current Thread