Performing complicated XPath queries in Scala

Posted by Ken Bloom on Stack Overflow See other posts from Stack Overflow or by Ken Bloom
Published on 2010-06-16T19:01:56Z Indexed on 2010/06/16 19:02 UTC
Read the original article Hit count: 238

Filed under:
|
|
|

What's the simplest API to use in scala to perform the following XPath queries on a document?

//s:Annotation[@type='attitude']/s:Content/s:Parameter[@role='type' and not(text())]

//s:Annotation[s:Content/s:Parameter[@role='id' and not(text())]]/@type

The only documentation I can find on Scala's XML libraries has no information on performing complicated real XPath queries.

I used to like JDOM for this purpose (in Java), but since JDOM doesn't support generics, it will be painful to work with in Scala. (Other XML libraries for Java have tended to be even more painful in Java, but I admit I don't know the landscape real well.)

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml