1

私はしばらくの間コードを変更しようとしてきましたが、変更できませんでした。

準備スコアを3.72でピークに設定し、ここでコードを表示して機能させることができます: リンクが削除されました

ただし、ready.mobiと一緒に使用する場合:ready.mobi / launch.jsp?locale = en_EN#fragment-1

次のエラーが発生します。

    FAIL near line -1 column -1
    Your page does not validate against XHTML Basic 1.1 or XHTML Mobile Profile 1.2

    FAIL near line 41 column 17
    The content of element type "a" must match "(br|span|em|strong|dfn|code|samp|kbd|var|cite|abbr|acronym|q|tt|i|b|big|small|sub|sup|img|object|input|select|textarea|label|button|script|noscript)".

    FAIL near line 46 column 17
    *same element type "a" error line

    FAIL near line 51 column 17
    *same element type "a" error line

    FAIL near line 56 column 17
    .....

    FAIL near line 61 column 17
    ...

マークアップエラーが原因で、xhtmlモバイルプロファイルも失敗します。

しかし、そうは言っても、コードが次のようなものである場合、xhtmlモバイルプロファイルとマークアップの両方が有効な場合、私のスコアは5になる可能性があります。 リンクが削除されました

バリデーターが受け入れるために、ネストの順序が変更されます。ただし、これによりリンクが切断されます。

前:

    <xsl:element name="a">
    <xsl:attribute name="href">
        <xsl:value-of select="link"/>
    </xsl:attribute>
</xsl:element>
    <xsl:element name="p"><xsl:attribute name="class"><xsl:text>more</xsl:text></xsl:attribute><xsl:text>more...</xsl:text></xsl:element>

後:

    <xsl:element name="a">
    <xsl:attribute name="href">
        <xsl:value-of select="link"/>
    </xsl:attribute>
    <xsl:element name="p"><xsl:attribute name="class"><xsl:text>more</xsl:text></xsl:attribute><xsl:text>more...</xsl:text></xsl:element>
</xsl:element>

どんな助けでもありがたいです。:) どうもありがとう!!!

4

1 に答える 1

1

<a>中に入れたらどう<p>ですか?

<xsl:element name="p"><xsl:attribute name="class"><xsl:text>more</xsl:text></xsl:attribute>
 <xsl:element name="a">
    <xsl:attribute name="href">
        <xsl:value-of select="link"/>
    </xsl:attribute>
    <xsl:text>more...</xsl:text></xsl:element>
</xsl:element>

または、もっと簡単に言えば、リテラル結果要素と属性値テンプレートを使用してhref

<p class="more"><a href="{link}">more...</a></p>
于 2012-12-03T12:26:39.527 に答える