28 Apr 2004 18:28
Re: xml document to node (object)
On 28 Apr 2004, at 16:56, Joe Germuska wrote: > I promise that I've looked around on the web site, but I haven't found > something I kind of expected: is there a low-level way to produce some > object by consuming an XML source? I'm thinking of something along > the lines of XMLTramp (http://www.aaronsw.com/weblog/000918), but > really, anything that says "here's an XML file, give me an object that > makes it easy to use". It looks like everything in the groovy.xml > package goes in the other direction. Its in the wrong package & needs moving to the groovy.xml package but we have import groovy.util.XmlParser doc = new XmlParser().parse("foo.xml") headings = doc.body.h1 etc e.g. http://cvs.groovy.codehaus.org/groovy/groovy-core/src/test/groovy/util/ XmlParserTest.groovy?rev=1.5&view=auto James ------- http://radio.weblogs.com/0112098/
RSS Feed