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.
This commit is contained in:
Pierre Labastie 2023-03-19 10:10:24 +01:00
parent 24ad4fd4f4
commit 6ac0d96300

View file

@ -930,22 +930,15 @@ echo Size after install: $(sudo du -skx --exclude home $BUILD_DIR) >> $INFOLOG
<xsl:template match="userinput" mode="destdir"> <xsl:template match="userinput" mode="destdir">
<xsl:text> <xsl:text>
</xsl:text> </xsl:text>
<xsl:choose> <xsl:for-each select="./literal">
<xsl:when test="./literal">
<xsl:call-template name="outputpkgdest"> <xsl:call-template name="outputpkgdest">
<xsl:with-param name="outputstring" select="text()[1]"/> <xsl:with-param name="outputstring" select="preceding-sibling::text()[1]"/>
</xsl:call-template> </xsl:call-template>
<xsl:apply-templates select="literal"/> <xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:call-template name="outputpkgdest"> <xsl:call-template name="outputpkgdest">
<xsl:with-param name="outputstring" select="text()[2]"/> <xsl:with-param name="outputstring" select="text()[last()]"/>
</xsl:call-template> </xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="outputpkgdest">
<xsl:with-param name="outputstring" select="string()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
<xsl:template name="outputpkgdest"> <xsl:template name="outputpkgdest">