locked
select item index 0 RRS feed

  • Question

  • User-646447061 posted

    i have data xml ..
    <item> 0
    <title></title>
    <dscription></description>
    <item>
    <item>1
    <title></title>
    <dscription></description>
    <item>
    <item>2
    <title></title>
    <dscription></description>
    <item>

    how make it display in browser, select index 0
    thanks

    Thursday, December 17, 2015 6:07 AM

Answers

All replies

  • User1724605321 posted

    Hi motorrevo00,

    Welcome to ASP.NET Forum .

    how make it display in browser, select index 0

    Please explain more about your requirement , are you want to get "0" from your xml file ? In addition , your xml structure is not correct . You could put 0,1,2 to a node :

    <index>0</index>

    Or  node attribute:

    <item index="0"> </item>

    Best Regards,

    Nan Yu

    Thursday, December 17, 2015 7:32 AM
  • User-646447061 posted

    hello nan yu, 
    i have 
    <item>this data change every week</item>

    <item>this data change every week</item>

    <item>this data change every week</item>

    can i display only top data ?  <solved>i use this code rss/channel/item[1]

    Question 2 :

    <itunes:category text="Religion & Spirituality"/>

    i want to get text "Religion & Spirituality" can you help me ?  i try to write like this <%# XPath("itunes:category/@text")%> but can't ..

    Friday, December 18, 2015 12:35 AM
  • User1724605321 posted

    Hi motorrevo00,

    i want to get text "Religion & Spirituality" can you help me ?  i try to write like this <%# XPath("itunes:category/@text")%> but can't ..

    Please refer to below article for tutorial :

    http://www.w3schools.com/xsl/xpath_syntax.asp

    Or you could use Linq to xml , please refer to below demo :

    How to: Find an Element with a Specific Attribute

    Best Regards,

    Nan Yu
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 22, 2015 9:50 AM