|
Hi,
I've got a problem with selectSingleNode. I have a
XML-Document like
<Benutzer >
<Benutzer_rec> <pkID>-1</pkID> <Nachname><![CDATA[Negativer]]></Nachname> </Benutzer_rec> <Benutzer_rec> <pkID>-2</pkID> <Nachname><![CDATA[Wert-2]]></Nachname> </Benutzer_rec> </Benutzer>
I put the two nodes <Benutzer_rec> in a new
list and use the following code to select the childnodes:
for (
Iterator iter = newContacts.iterator(); iter.hasNext(); )
{
Element element = (Element) iter.next(); System.out.println("Komplett: " + element.asXML()); System.out.println("Name: " + element.selectSingleNode("//Nachname").getText()); } I can iterate over the elements, of course no problem. "element.asXML()" shows me the right element. But "selectSingleNode("//Nachname").getText())" always gives me the same value "Negativer"! Is this a bug or am I doing something wrong? Thanks for any help,
Christoph
|
- Re: [dom4j-user] selectSingleNode Christoph Vollmer
- Re: [dom4j-user] selectSingleNode Markus Spath
