Java xpath selection -


I have a problem getting value from the XML document, the document looks like this:

  & lt; MarketStat & gt; & Lt; Type id = "35" & gt; & Lt; Sell ​​& gt; & Lt; Median & gt; 6.00 & lt; / Median & gt; & Lt; / Sell & gt; & Lt; / Type & gt; & Lt; Type id = "34" & gt; & Lt; Sell ​​& gt; & Lt; Median & gt; 2.77 & lt; / Median & gt; & Lt; / Sell & gt; & Lt; / Type & gt; & Lt; / Marketstat & gt;  

I have to get average where type = x

I was always having trouble finding xpath with java and I have got a good tutorial for this or Reference will not be found. If someone can help me understand that it will be great.

For the XPTH side of the problem: this should do the trick

  // * / type [@ id = '34 '] / * / mean /  

when I'm working with XPATH Usually I use W3Schools as a reference. And in IBM Developer Works


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -