Why?In a world full of bloat it's hard to move forward. Step aside and look for other ways to deal with XML. Forget W3C, DOM and SAX.
Open your mind.
XML is just a string. You don't need several megabytes of libraries for that. Just cut through and get what you are looking for.
XML Zen is here to help.
If you use Java and share same beliefs, write an email to email@example.com and join the development.
Read the Motivation for more details.
How?XmlBuilder ExampleCodeString xml = XmlBuilder.newXml()
.withValue("you can build")
.openTag("your").withAttribute("xml", "nicely").toString();XML (formatted)
you can build
String value = XmlSlicer.cut(xmlString).get("tagB").get("innerTag1").get("tag3").toString();ExplanationThe following code creates a new instance of XmlSlicer for input String (xmlString).
XmlSlicer.cut(xmlString)As slicer can slice into a unique tag, to get the value of /tagB/innerTag1/tag3 we have to get deeper two times before tag3 becomes unique.
First cut (tag2) returns:
Second cut (innerTag1) returns:
6And the last cut (tag2) gets our value - 6.
Use Patent Claims
These details are provided for information only. No information here is legal advice and should not be used as such.