Please help me in finding the xpath for these nodes

<IPAddses>
<IPAddss><ix>0</ix><addss >124.123.123.330</addss ><desc /></IPAddss>
<IPAddss><ix>1</ix><addss >124.123.123.331</addss ><desc /></IPAddss>
<IPAddss><ix>2</ix><addss >124.123.123.332</addss ><desc /></IPAddss>
<IPAddss><ix>3</ix><addss >124.123.123.333</addss ><desc /></IPAddss>
<IPAddss><ix>4</ix><addss >124.123.123.334</addss ><desc /></IPAddss>
<IPAddss><ix>5</ix><addss >124.123.123.335</addss ><desc /></IPAddss>
<IPAddss><ix>6</ix><addss >124.123.123.336</addss ><desc /></IPAddss>
<IPAddss><ix>7</ix><addss >124.123.123.337</addss ><desc /></IPAddss>
<IPAddss><ix>8</ix><addss >124.123.123.338</addss ><desc /></IPAddss>
<IPAddss><ix>9</ix><addss >124.123.123.339</addss ><desc /></IPAddss>
</IPAddses>

in this xml above, i need xpath to get the value of the ipaddresses

eg for getting 124.123.123.330 what xpath should i use?

/IPAddses/IPAddss/addss

no that will not work, i have tried it already,

/IPAddses/IPAddss/addss

this path will represent all the ip's , say i need to get the first one alone.. there is a nod <ix> which has values 0 to 9.. somehow this node has to be used in the xpath .. bu i am not sure of how to.,,,

Edited 4 Years Ago by depakjan: n/a

Try the below if you want the first IP address

/IPAddses/IPAddss[1]/addss

[1] means the position of <IPAddss>.
If you want to fetch the address depending upon <ix> then try the following

/IPAddses/IPAddss[ix = '0']/addss
This article has been dead for over six months. Start a new discussion instead.