Remove all &#xxx; occurences

- replace some characters by their utf-8 encoded equivalent (and change
  encoding in the <?xml?> line
- replace &#xa; with a true newline char. This is somewhat more readable
  anyway.
This commit is contained in:
Pierre Labastie 2024-01-18 20:35:28 +01:00
parent 9512d6c7ba
commit 2a26a4f5df
6 changed files with 37 additions and 26 deletions

View File

@ -7,7 +7,8 @@
<!-- XSLT stylesheet to extract commands from [B,H]LFS books. -->
<xsl:variable name="newline">
<xsl:text>&#xA;</xsl:text>
<xsl:text>
</xsl:text>
</xsl:variable>
<xsl:template match="/">

View File

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
@ -51,8 +51,10 @@
<!-- Allow URLs to be automatically hyphenated.
We have expanded the support to several inline tags.
See pdf/lfs-mixed.xsl -->
<xsl:param name="ulink.hyphenate" select="'&#x200B;'"/>
See pdf/lfs-mixed.xsl.
Note: the argument in select= is a zero-width space
(unicode 200b, encoded in utf-8)-->
<xsl:param name="ulink.hyphenate" select="''"/>
<!-- List of characters to allow ulink URLs, and supported inline tags,
to be automatically hyphenated on.

View File

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
@ -294,7 +294,9 @@
</td>
</xsl:when>
<xsl:when test="$numcols &gt; 3">
<td>&#160;</td>
<!-- The space between <td> and </td> is a non breakable
space (unicode A0) encoded in utf-8.-->
<td> </td>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml version='1.0' encoding='UTF-8'?>
<!-- Create a md5 list for packages and pathces used. -->
<!-- Create a md5 list for packages and patches used. -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
@ -31,7 +31,8 @@
</xsl:call-template>
<!-- Add a newline -->
<xsl:text>&#x0a;</xsl:text>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
@ -55,4 +56,3 @@
</xsl:template>
</xsl:stylesheet>

View File

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
@ -22,26 +22,30 @@ function copy
cp $1 $2 >>copyerrs 2>&amp;1
}
umask 002 &#x0a;&#x0a;</xsl:text>
umask 002
<!-- Create dest.dir if it don't exist -->
<xsl:text>install -d -m 775 -g lfswww </xsl:text>
# Create dest.dir if it doesn't exist
# Remove old patches
# Copy the patches
# Ensure correct ownership
install -d -m 775 -g lfswww </xsl:text>
<xsl:value-of select="$dest.dir"/>
<xsl:text> &amp;&amp;&#x0a;</xsl:text>
<xsl:text>cd </xsl:text>
<xsl:text> &amp;&amp;
cd </xsl:text>
<xsl:value-of select="$dest.dir"/>
<xsl:text> &amp;&amp;&#x0a;&#x0a;</xsl:text>
<!-- Remove old patches -->
<xsl:text>rm -f *.patch copyerrs &amp;&amp; &#x0a;&#x0a;</xsl:text>
<xsl:text> &amp;&amp;
rm -f *.patch copyerrs &amp;&amp;
</xsl:text>
<xsl:apply-templates/>
<!-- Ensure correct owneship -->
<xsl:text>&#x0a;chgrp lfswww *.patch &amp;&amp;&#x0a;</xsl:text>
<xsl:text>
chgrp lfswww *.patch &amp;&amp;
if [ `wc -l copyerrs | sed 's/ *//' | cut -f1 -d' '` -gt 0 ]; then
mail -s "Missing LFS patches" lfs-book@lists.linuxfromscratch.org &lt; copyerrs
fi&#x0a;&#x0a;</xsl:text>
fi
<xsl:text>exit&#x0a;</xsl:text>
exit
</xsl:text>
</xsl:template>
<xsl:template match="//text()"/>
@ -59,10 +63,11 @@ fi&#x0a;&#x0a;</xsl:text>
<xsl:value-of select="$cut"/>
</xsl:variable>
<xsl:text>copy /srv/www/www.linuxfromscratch.org/patches/downloads/</xsl:text>
<xsl:value-of select="substring-before($patch.name2, '-0')"/>
<xsl:value-of select="substring-before($patch.name2, '-0')"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="$patch.name"/>
<xsl:text> . &#x0a;</xsl:text>
<xsl:text> .
</xsl:text>
</xsl:if>
</xsl:template>

View File

@ -28,7 +28,8 @@
<xsl:value-of select="@url"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#x0a;</xsl:text>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>