简短的问题:我想选择不匹配的属性的所有节点,但也属性不存在(??)(@type =“X”!)。 目前,我得到任何回报,因为其他节点没有属性可言。
背景:我有一些XML。 需要注意的是一个具有类型=“功能”,但所有其他人都没有“类型” 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>