Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Q: Avoiding XPath - using GPath

grkuntzmd

2008-08-21

Replies: Find Java Web Hosting

Author LoginPost Reply

I played with this yesterday for about 1/2 hour, but could not come up with the right GPATH code

I have an XML document with the following structure:

<data>
  <common-tables>
    <table name="address"/>
    <table name="phone"/>
  </common-tables>

  <special-tables>
    <table name="person"/>
  </special-tables>

  <other-tables>
    <table name="business"/>
  </other-tables>
</data>

I was trying to come up with GPath code that lets me get the name attributes from the table elements, but only if they are under the "common-tables" or "special-tables", excluding those under the "other-tables".

I tried both XmlParser and XmlSlurper, and all combinations of findAll that I could think of.

I am a Groovy-Newbie (I should trademark that :-)) and searched the Groovy home, as well as all of my Groovy books.

Any ideas?

G. Ralph Kuntz, MD
Chief Software Architect
meridianEMR, Inc.


View this message in context: Q: Avoiding XPath - using GPath
Sent from the groovy - user mailing list archive at Nabble.com.
©2008 gg3721.com - Jax Systems, LLC, U.S.A.