XML : parse xpath expression and convert to JSON

I would like to parse the xpath expressions and show it in a html TreewView.

I have tried this library which parses the xpath correctly but it doesn't return the output in JSON format.

The toString() method of this library returns the output in below format which looks like JSON but not.

xPath:

  /bookstore/book[price>35]/price    

Output:

  {path-expr:abs,{{step:child,bookstore},{step:child,book,{{binop-expr:>,{path-expr:rel,{{step:child,price}}},{num:35}}}},{step:child,price}}}    

Please help.

Thanks.

No comments:

Post a Comment