Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.5
-
None
Description
I am trying to parse HTML with XmlParser (see example below).
I expect both expressions
html.body
and
html.":body"
will return the same value, since namespace prefix is empty.
But the first one does not work (it rerurns empty list).
Sorce code:
import groovy.xml.* def text = """ <html xmlns="http://www.w3.org/1999/xhtml"> <body> text </body> </html> """ def html = new XmlParser().parseText(text) println html.body println html.":body"
Result:
[]
[
body[attributes={}; value=[text]]]