It might be helpful if you provided simple sample input <span style="font-style: italic;">and</span> output. I honestly don't follow what it is you want to do; especially confusing (to me at least) is why the lookup and id attributes (for KEYs elements) and the name and id attributes (for Area elements) have the same values.
<br><br>In your code, where is the getSingleElementbyXPath() method defined?<br><br><br><div><span class="gmail_quote">On 11/27/06, <b class="gmail_sendername"><a href="mailto:Power_PC@gmx.net">Power_PC@gmx.net</a></b> &lt;
<a href="mailto:Power_PC@gmx.net">Power_PC@gmx.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>my problem is to resolve references to other xml-tags. Here is my xml file:
<br><br><br>&lt;Project&gt;<br>&nbsp;&nbsp;&lt;KEYs name=&quot;host&quot; id=&quot;23&quot; lookup=&quot;/Project/Area/[@name=''YES']&quot; id=&quot;/&nbsp;&nbsp;&nbsp;&nbsp;Project/Area/[@name=''YES']&quot; /&gt;<br>&nbsp;&nbsp;&lt;KEYs name=&quot;server&quot; id=&quot;404&quot; lookup=&quot;/Project/Area/[@name=''XOR']&quot; id=&quot;/Project/Area/[@name=''XOR']&quot; /&gt;
<br>...<br><br>&lt;Area name=&quot;YES&quot; id='&quot;YES&quot;'/&gt;<br>&lt;Area name=&quot;XOR&quot; id='&quot;XOR&quot;'/&gt;<br>...<br><br>&lt;/Project&gt;<br><br>i want to resolve the references - after importing the file i want to show:
<br>...lookup= and here should be the value of the references - a pointer should go to Project--Area--name--yes, this mean in the tag area where name is yes and id is yes, so finally the xml file should have the resolved value. i have tried with xpath and saxbuilder, but it doesnt work: here my codesample:
<br><br><br>...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public static void main(String[] args) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SAXBuilder builder = new SAXBuilder();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlfile = 
builder.build( new File(&quot;sample/xdstrainig.xml&quot;));<br>getRoot = xmlfile.getRootElement();<br>allvalue = getSingleElementbyXPath(&quot;/Project/KEYs[@name='host']&quot;);<br>List mylist = getRoot.getChildren(&quot;KEYs&quot;);
<br>Iterator iter = mylist.iterator();<br>Element e;<br>while(iter.hasNext() {<br> e = (Element) iter.next();<br> String stringName = e.getName();<br> Element e2 = (Element) XPath.selectSingleNode(getRoot, &quot;/Project/KEYs/&quot; +stringName);
<br><br>...<br>but how to resolve the references? I think with getSingleElementbyXPath(), but how can i do this??<br>THX for any suggestions!!!!!!<br>Kind regards,<br>Jack<br>--<br>&quot;Ein Herz für Kinder&quot; - Ihre Spende hilft! Aktion: 
<a href="http://www.deutschlandsegelt.de">www.deutschlandsegelt.de</a><br>Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!<br>_______________________________________________<br>To control your jdom-interest membership:
<br><a href="http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com">http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com</a><br></blockquote></div><br>