Changeset 6ac0d96 for BLFS/xsl


Ignore:
Timestamp:
03/19/2023 09:10:24 AM (16 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, trunk
Children:
3fa4147
Parents:
24ad4fd
Message:

outputpkgdest: fix the case of several <literal>

We output text()[1], literal (literally), text(2). This does
not work if there are several <literal> tags. Change it to
outputing preceding-sibling::text()[1], literal for each
literal tag, then output text()[last()] (which works also
when there are no literal tag, so it removes a choose.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/xsl/scripts.xsl

    r24ad4fd r6ac0d96  
    931931    <xsl:text>
    932932</xsl:text>
    933     <xsl:choose>
    934       <xsl:when test="./literal">
    935         <xsl:call-template name="outputpkgdest">
    936           <xsl:with-param name="outputstring" select="text()[1]"/>
    937         </xsl:call-template>
    938         <xsl:apply-templates select="literal"/>
    939         <xsl:call-template name="outputpkgdest">
    940           <xsl:with-param name="outputstring" select="text()[2]"/>
    941         </xsl:call-template>
    942       </xsl:when>
    943       <xsl:otherwise>
    944         <xsl:call-template name="outputpkgdest">
    945           <xsl:with-param name="outputstring" select="string()"/>
    946         </xsl:call-template>
    947       </xsl:otherwise>
    948     </xsl:choose>
     933    <xsl:for-each select="./literal">
     934      <xsl:call-template name="outputpkgdest">
     935        <xsl:with-param name="outputstring" select="preceding-sibling::text()[1]"/>
     936      </xsl:call-template>
     937      <xsl:apply-templates select="."/>
     938    </xsl:for-each>
     939    <xsl:call-template name="outputpkgdest">
     940      <xsl:with-param name="outputstring" select="text()[last()]"/>
     941    </xsl:call-template>
    949942  </xsl:template>
    950943
Note: See TracChangeset for help on using the changeset viewer.