groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Myers <am2...@gmail.com>
Subject org.xml.sax.SAXParseException with XmlSlurper
Date Thu, 19 Nov 2015 01:47:33 GMT
Hi,

For a while I've been using groovy to parse some badly formed HTML via 
XmlSlurper in conjunction with TagSoup, something like this:

def slurper = new XmlSlurper(new org.ccil.cowan.tagsoup.Parser())
def html = slurper.parseText(htmlText)

It works fine when I unit test it with Gradle, but I've tried to deploy 
this inside another webapp which runs on Lucee (http://lucee.org/) but I 
think I'm running into some kind of "Jar hell".  When I try to parse the 
htmlText, I get an error like this which makes me think it's not using 
the tagsoup Parser

The exception is: org.xml.sax.SAXParseException, with a stracktrace 
starting like this:

The element type "meta" must be terminated by the matching end-tag 
"</meta>". at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown 
Source):-1 at 
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source):-1 at groovy.util.XmlSlurper.parse(XmlSlurper.java:205):205 at 
groovy.util.XmlSlurper.parse(XmlSlurper.java:258):258 at 
groovy.util.XmlSlurper.parseText(XmlSlurper.java:284):284 at 
groovy.util.XmlSlurper$parseText.call(Unknown Source):-1 at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45):45 
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108):108

at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116):116

at

I'm a bit lost as to what to look for to debug this.  Has anyone come 
across anything similar?

Thanks!
Andrew.

Mime
View raw message