I am using Jodd Lagarto to parse some HTMLs. For some cases I also use Jerry, when I need to quickly process HTML. But now, I have some XMLs that I need to process. From the TagVisitor
it looks like Lagarto may process XMLs as well (that would be awesome for me), but... I am not quite sure on how to do this.
Did anyone used Jodd Lagarto to process XMLs and how?
Yes, it is possible to use Lagarto for XML. I admit this is not so clear in the documentation, but there is way to enable xml mode for parsing. Here is a short example how:
That's all! Method
enableXmlMode
sets several flags to make Lagarto parsing XMLs.Even more, you can even use Jerry for parsing XMLs, too! Here is how:
Now you can use jQuery syntax and CSS selectors to filter your XML (aint that awesome, or what;)