Replace unknown XML entities with their numerical counterpart.
authorJohn Darrington <john@darrington.wattle.id.au>
Thu, 8 Jul 2010 13:24:11 +0000 (15:24 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Thu, 8 Jul 2010 13:24:11 +0000 (15:24 +0200)
Texinfo seems to produce XML entities (such as &copy;) which
are not valid (although they are valid for HTML).  We work
around such problems by post-processing with sed. Here, we
replace these unknown entities with their numeric counterparts.
Such is the advice given at
http://www.dwheeler.com/essays/quotes-in-html.html

doc/automake.mk

index b31aa769b48291670e0ffeb7e8162c13ca4a8f8c..af99930f875a08b537498209724de5ec20aced57 100644 (file)
@@ -56,7 +56,18 @@ $(srcdir)/doc/pspp.xml: doc/pspp.texinfo $(doc_pspp_TEXINFOS)
        @$(MKDIR_P)  doc
        $(MAKEINFO) $(AM_MAKEINFOFLAGS) --docbook -I $(top_srcdir) \
                $(top_srcdir)/doc/pspp.texinfo -o - \
-               | $(SED) 's/Time-&-Date/Time-\&amp;-Date/g' > $@
+               | $(SED) -e 's/Time-&-Date/Time-\&amp;-Date/g' \
+               -e 's/&ldquo;/\&#8220;/g' \
+               -e 's/&rdquo;/\&#8221;/g' \
+               -e 's/&lsquo;/\&#8216;/g' \
+               -e 's/&rsquo;/\&#8217;/g' \
+               -e 's/&mdash;/\&#8212;/g' \
+               -e 's/&ndash;/\&#8242;/g' \
+               -e 's/&copy;/\&#0169;/g' \
+               -e 's/&minus;/\&#8722;/g' \
+               -e 's/&hellip;/\&#8230;/g' \
+               -e 's/&period;/./g' \
+               > $@
        $(XMLLINT) --output /dev/null $@ 2>&1 2> /dev/null || ( $(RM) $@ && false )
 
 docbookdir = $(docdir)