1

次のような xml があり、タグCellのテンプレートを属性aid5:cellstyle="hilite_white"と一致させたいとします。

:のような特別な文字を持つ属性を選択できないため、XSLT テンプレートでそれを行うにはどうすればよいですか?

<table>
<Cell aid:table="cell" aid5:cellstyle="hilite_white" aid:crows="1" aid:ccols="1" aid:ccolwidth="112" />
</table>

@ジム:これが私が試したことです

<xsl:template match="Cell[@aid5:cellstyle='hilite_white']">
            <xsl:value-of select="local-name()" />

        </xsl:template>
4

1 に答える 1

1

*一致の名前空間プレフィックスとして次のいずれかを使用できます。

match="Cell[@*:cellstyle='hilite_white']"

または、次のようにプレフィックスを宣言できますxsl:stylesheet

<xsl:stylesheet version="2.0" xmlns:aid5="unknown namespace uri" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

(unknown namespace uri名前空間 uri がソース XML にあるものに置き換えます。)

于 2012-12-17T05:31:29.547 に答える