How can I select the first element using XSLT?

后端 未结 4 1035
栀梦
栀梦 2021-02-03 21:38

I have a list of news items, sorted by dateCreated. I have a preview box control where I only want to show the first item. How can I do that using XSLT?



        
4条回答
  •  暖寄归人
    2021-02-03 21:42

    //newsItem[1]
    

    Selects the first book newsItem element, but note that IE5 and later has implemented that [0] should be the first node, but according to the W3C standard it should be [1]!

提交回复
热议问题