私はいくつかのhtmlをきれいにしようとしています。私は整頓してxhtmlに変換しましたxsltproc html文書
$ tidy -asxml -i -w 150 -o o.xml index.html
最終的に得られたxhtmlは名前付きエンティティを持ちます。 これらのxhtmlでxsltprocを実行しようとすると、エラーが発生します。
$ xsltproc --novalid -o out.htm t.xsl o.xml
o.xml:873: parser error : Entity 'mdash' not defined
resources to storing data and using permissions — as needed.</
^
o.xml:914: parser error : Entity 'uarr' not defined
</div><a href="index.html#top" style="float:right">↑ Go to top</a>
^
o.xml:924: parser error : Entity 'nbsp' not defined
Android 3.2 r1 - 27 Jul 2011 12:18
私はそれが(有効である)と同じ名前を持つ属性の名前とIDを持つタグに文句を言うのxsltprocに--html追加する場合
$ xsltproc --novalid --html -o out.htm t.xsl o.xml o.xml:845: element a: validity error : ID top already defined
<a name="top" id="top"></a>
^
XSLTは単純です:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//*[@id=side-nav]"/>
</xsl:stylesheet>
なぜ--htmlは機能しませんか?なぜそれは不平を言うのですか?または、私はそれを忘れてエンティティを修正する必要がありますか?
質問は何ですか?私はそれを見ない。 –