XPath-Problems when selecting a attribute of a XML-Tag
I could use a little help with an XPath-Expression. check the code below; how do I select the attribute "idc" at the shown point?
<!-- XML-Code -->
<pictGaleList>
开发者_运维技巧<item>
</item>
<dateItem>
<ImageDate idc="20">
20/04/2010
</ImageDate>
</dateItem>
</pictGaleList>
<!-- XSLT -->
<xsl:template match="pictGaleList">
<xsl:value-of select="" /> <!-- here I need the value of the attribute "idc" -->
</xsl:template>
dateItem/ImageDate/@idc
?
dateItem[position() = 1]/ImageDate/@idc
Will give you the value of 1st ImageDate element's idc attribute inside pictGaleList
Solved, the false behaviour if the website didn't come from this code. nvrmnd
精彩评论