[jdom-interest] (no subject)

Robert (Jamie) Munro rjmunro at viva.org
Tue May 27 11:36:33 PDT 2003


I've been using XML that looks like this:

<a name="x">
  <b>
    <c>Some stuff</c>
    <c>Some stuff</c>
    <c>Some stuff</c>
    <c>Some stuff</c>
    <c>Some stuff</c>
  </b>
</a>

I've been using elementScannner from the contrib to pass me all the <c>s.

Previously, when I was passed the element <c> above, I could access the
value of a's name (in this case "x") as follows:

elementMatched(String path, Element e) {
  String parentName = e.getParent().getParent().getAttributeValue("name");
}

This no longer works because getParent() returns a Parent instead of an
Element. Is there a way around this?

Thanks,

Robert Munro




More information about the jdom-interest mailing list