|
GPath: descendant-or-self ?: msg#00127lang.groovy.user
Hi I like the Groovy simple syntax to query XML, but I can't find how to do the equivalent of descendant-or-self XPath expression. For instance, how can I print the names of all elements which tag is "X", when this tag can be used at any level of the XML tree ? For these two files: 1.xml: <X name="one"> <Y> <X name="two"/> </Y> </X> 2.xml: <Y> <Y> <X name="one"> <X name="two"/> </X> </Y> </Y> I want to have the following output: one two In XPath, I would simply do "//X/@name" Thanks for your help
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: evaluate(file) inside script fails, juhani |
|---|---|
| Next by Date: | lauching groovyConsole on MacOS X, Yvon Thoraval |
| Previous by Thread: | evaluate(file) inside script fails, juhani |
| Next by Thread: | lauching groovyConsole on MacOS X, Yvon Thoraval |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |