短い質問: アトリビュート(@type!= 'x')と一致しないアトリビュートは存在しません(??)。 現在、他のノードには属性がまったくないため、何も戻っていません。xpathアトリビュートが存在しないときに属性で選択
背景: 私はいくつかのXMLを持っています。 1つはtype = "feature"を持っていますが、他はすべて "type" attrを持たないことに注意してください。
<image type="feature"><description>X</description><url>media/designer_glass_tile_04.jpg</url><height></height><width/></image>
<image><description>Designer Glass 05</description><url>media/designer_glass_tile_05.jpg</url><height></height><width/></image>
<image><description>Designer Glass 06</description><url>media/designer_glass_tile_06.jpg</url><height></height><width/></image>
<image><description>Designer Glass 07</description><url>media/designer_glass_tile_07.jpg</url><height></height><width/></image>
<image><description>Designer Glass 08</description><url>media/designer_glass_tile_08.jpg</url><height></height><width/></image>
とXSLスタイル:時間
<div id="gallery">
<div id="feature" >
<xsl:apply-templates select="image[@type='feature']"/>
</div>
<div id="thumbs">
<xsl:apply-templates select="image[@type!='feature']"/>
</div>
</div>
感謝。
select="image[not(@type)]"
は、あなたのコード内でこのロジックを追加します。
十分に簡単に試してみてください。ポインタのおかげで。 –