tags:

views:

26

answers:

0

Hi,

I am quite new with Grails and now I have a problem while using NodeBuilder and GPath. Here is the code snippet

def builder = new NodeBuilder()
def menu = builder.menu {
    header(title: "header 1") {
       submenu(title: "submenu 1.1")
       submenu(title: "submenu 1.2")
    }
    header(title: "header 2")
}

menu.grep {
   println it.'@title'
}

When I executed it with Groovy 1.7.2, the result was:

header 1
header 2

which just like I expected. But when I executed the code in Grails 1.3.1, the result was different. The result was:

submenu 1.1
submenu 1.2

any idea why this happened?