I need to extract some of the HTML from this HTML page. So far, I'm using XmlSlurper with tagoup to parse an HTML page, and then try to get the part I need using StreamingMarkupBuilder:
import groovy.xml.StreamingMarkupBuilder def html = "<html><body>a <b>test</b></body></html>" def dom = new XmlSlurper(new org.ccil.cowan.tagsoup.Parser()).parseText(html) println new StreamingMarkupBuilder().bindNode(dom.body)
However i get the result
<html:body xmlns:html='http://www.w3.org/1999/xhtml'>a <html:b>test</html:b></html:body>
which looks great, but I would like to get it without the html namespace.
How to avoid namespace?
source share