开发者

XPath-Problems when selecting a attribute of a XML-Tag

开发者 https://www.devze.com 2023-01-11 05:34 出处:网络
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?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消