jhalfs git · trunk
jhalfs LFS build automation (mirror)
Python 78.4% Shell 19.8% Makefile 1.8%git clone https://git.christianimmanuel.de/mirrors-forks/jhalfs.gitwget https://git.christianimmanuel.de/mirrors-forks/jhalfs/archive/jhalfs.tar.gzoutputpkgdest: 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.
BLFS/xsl/scripts.xsl | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl index eb04609..d5d0fa3 100644 --- a/BLFS/xsl/scripts.xsl +++ b/BLFS/xsl/scripts.xsl @@ -930,22 +930,15 @@ echo Size after install: $(sudo du -skx --exclude home $BUILD_DIR) >> $INFOLOG <xsl:template match="userinput" mode="destdir"> <xsl:text> </xsl:text> - <xsl:choose> - <xsl:when test="./literal"> - <xsl:call-template name="outputpkgdest"> - <xsl:with-param name="outputstring" select="text()[1]"/> - </xsl:call-template> - <xsl:apply-templates select="literal"/> - <xsl:call-template name="outputpkgdest"> - <xsl:with-param name="outputstring" select="text()[2]"/> - </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:for-each select="./literal"> + <xsl:call-template name="outputpkgdest"> + <xsl:with-param name="outputstring" select="preceding-sibling::text()[1]"/> + </xsl:call-template> + <xsl:apply-templates select="."/> + </xsl:for-each> + <xsl:call-template name="outputpkgdest"> + <xsl:with-param name="outputstring" select="text()[last()]"/> + </xsl:call-template> </xsl:template> <xsl:template name="outputpkgdest">