Hi,
Below is my sample XML data:
ABC
2011
ABC
2010
DEF
2011
Currently, I am using XPath to parse XPath Expressions and it is working fine.
String stringData = "count(data/books/book[name='ABC' and year='2011'] > 0";
XPath xpath = XPathFactory.newInstance().newXPath();
try
{
XPathExpression expr = xpath.compile(stringData);
(Boolean) result = (Boolean) expr.evaluate(doc, XPathConstants.BOOLEAN);
}
catch (XPathExpressionException e)
{ e.printStackTrace(); }
However, I need the stringData to be translated into this: FROM: count(data/books/book[name='ABC' and year='2011'] > 0 TO: data.books.book.name data.books.book.year
Are there any libraries that can handle this scenario?
Thanks!
Regards, Ruby
Submitted under:
Microsoft SQL Server · XQUERY · XML · ·