Interpret a rule applying multiple xpath queries on multiple XML documents

Posted by Damien on Stack Overflow See other posts from Stack Overflow or by Damien
Published on 2010-03-19T14:10:09Z Indexed on 2010/03/19 14:11 UTC
Read the original article Hit count: 213

Filed under:
|
|
|
|

Hi,

I need to build a component which would take a few XML documents in input and check the following kind of rules:

XML1:/bookstore/book[price>35.00] != null 
and (XML2:/city/name = 'Montreal'
     or XML3://customer[@language] contains 'en')

Basically my component should be able to:

  • substitute the XML tokens with the corresponding XML document(before colon)
  • apply xpath query on this XML document
  • check the xpath output against expected result ("=", "!=", "contains")
  • follow the basic syntax ("and", "or" and parentheses)
  • tell if the rule is true or false

Do you know any library which could help me? maybe JavaCC?

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about parser