groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Balachandran Sivakumar <benignb...@gmail.com>
Subject Re: XmlSlurper and XML includes
Date Tue, 13 Oct 2015 17:28:10 GMT
Hi Schalk,

On Tue, Oct 13, 2015 at 10:47 PM, Schalk Cronjé <ysb33r@gmail.com> wrote:

> With XmlSlurper it is possible to supply your own XMLReader or SAXParser.
> I am not sure how XmlSlurper initialises the underlying SAXParser, but the
> following might get you going
>
> def spf = javax.xml.parsers.SAXParserFactory.newInstance()
> spf.namespaceAware = true
> spf.setXIncludeAware ( true )  // for some reason spf.xIncludeAware = true
> does not compile
> def parser = new XmlSlurper(spf.newSAXParser())
>
> I hope that helps.
>
>
         Thanks, this works for me.  exactly what I was looking for. :)


>
>         new XmlSlurper( namespaceAware : true, xIncludeAware : true )
>
>
>
        Such a constructor would be awesome to have. Thanks



>
> --
> Schalk W. Cronjé
> Twitter / Ello / Toeter : @ysb33r
>
>


-- 
Thank you
Balachandran Sivakumar

Mime
View raw message