Tag Archives: xml

In looking over documentation on XPath queries it seemed easy enough to be able to pull out values from XML, but try as I might I kept getting no results back. Even searching on the root element “/elementName” didn’t return any results. Of course, as with all things Java there’s a trick and that trick is to call setNamespaceAware(). Here’s a quick and dirty example…

Ok, here’s another nerdy post for all the java developers out there. Hopefully it saves you some time.

Let’s say you have a XML DOM Document that you’ve been modifying in your code, and now want to write it back out as XML. One would think there would be a nice toXml() method or something on the Document, but there isn’t. Instead, make sure you have the xalan.jar file on your class path and use this function…