开发者

XSLT display item

开发者 https://www.devze.com 2023-01-04 20:52 出处:网络
In the following XML, I would like only get the number 2 and 5 items, how could it be done on XSLT? <root>

In the following XML, I would like only get the number 2 and 5 items, how could it be done on XSLT?

<root>
    <content>item 1</content>
    <开发者_如何学Python;content>item 2</content>
    <content>item 3</content>
    <content>item 4</content>
    <content>item 5</content>
    <content>item 6</content>
</root>


Try this:

<xsl:value-of select="/root/content[2]" /> 
<xsl:value-of select="/root/content[5]" /> 

NOTE:

Oded is right but I think this is the best you can get

0

精彩评论

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