Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi *,

On Fri, Oct 19, 2012 at 12:25 PM, Christian Lohmaier
<lohmaier+libreoffice@googlemail.com> wrote:
[...]
The additional html tags in the wiki-output on the <html> tag makes
the removal of the xmlns tag that is added by tidy fail.

i.e.  perl -pe 's|xmlns="http://www.w3.org/1999/xhtml";||'  does
nothing, since it is not
<html .. xmlns="http://www.w3.org/1999/xhtml"; ..> but

<html ... xmlns=<newline/>
"http://www.w3.org/1999/xhtml";>

so remove the xmlns declaration and just run the xslt commands
manually or fix the regular expression or something like that.

Or better - instead of trying to search and replace, also use xslt to
process the xml:

stripnamespace.xsl:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:output indent="yes"  encoding="UTF-8" method="xml"
omit-xml-declaration="yes"/>

        <xsl:template match="*">
                <xsl:element name="{name()}">
                        <xsl:apply-templates select="node()|@*"/>
                </xsl:element>
        </xsl:template>

        <xsl:template match="@*">
                <xsl:copy/>
        </xsl:template>
</xsl:stylesheet>


--- a/bug/Makefile
+++ b/bug/Makefile
@@ -18,7 +18,8 @@ all: extract compose

 extract:
        mkdir -p build
-       curl --silent
http://wiki.documentfoundation.org/BugReport_Details | tidy
--numeric-entities yes -asxhtml 2>/dev/null | perl -pe
's|xmlns="http://www.w3.org/1999/xhtml";||' >
build/BugReport_Details.xhtml
+       curl --silent
http://wiki.documentfoundation.org/BugReport_Details | tidy
--numeric-entities yes -asxhtml 2>/dev/null > build/tidyout.xhtml ||
echo "ignoring tidy error"
+       xsltproc --encoding UTF-8 --novalid stripnamespace.xsl
build/tidyout.xhtml > build/BugReport_Details.xhtml
        xsltproc --encoding UTF-8 --novalid component_comments.xsl
build/BugReport_Details.xhtml > build/component_comments.xhtml
        xsltproc --encoding UTF-8 --novalid subcomponents.xsl
build/BugReport_Details.xhtml > build/subcomponents.xhtml
        xsltproc --encoding UTF-8 --novalid components.xsl
build/BugReport_Details.xhtml > build/components.xhtml


ciao
Christian

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.