[ 
https://issues.apache.org/jira/browse/GROOVY-7489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614899#comment-14614899
 ] 

Suminda Dharmasena commented on GROOVY-7489:
--------------------------------------------

It will be much easier and less cryptic if you just say: 

{code}
def xml = '''
<items type="XYZ">
  <list>
    <x>1</x>
    <y>2</y>
    <z>3</z>
  </list>
  <list>
    <x>A</x>
    <y>B</y>
    <z>C</z>
  </list>
</items>
'''
def root = new XmlParser().parseText(xml)
root.level(2).each {
  println "${it.name()} ${it.text()}"
}
{code}

> List All Nodes +/-n levels from current node
> --------------------------------------------
>
>                 Key: GROOVY-7489
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7489
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-jdk
>            Reporter: Suminda Dharmasena
>            Priority: Minor
>              Labels: usertask
>
> Ability to query nodes at +/- n levels from the current level. If n = 0 then 
> nodes at current level.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to