Hello,
I can't get elementByID to behave as I had expected - what am I doing wrong?
The XPath version - selectSingleNode() - works fine, but the elementByID() 
version fails (messageEl == null)
What am I doing wrong here?

The code <AbstractBranch.java> looks straightforward enough, I can't see 
why it wouldn't work. Any suggestions?

==== Java snippet ====

             Element messageEl = document.elementByID ("message");
             //      Element messageEl = (Element) 
document.selectSingleNode ("//html/body/span");
             if (messageEl == null)
                 out.println ("\nMessage Not Found!\n");
             else {
                 messageEl.clearContent();
                 messageEl.addText ("Dynamic Sites Indeed");
             }

==========

The Document is built with SAXReader.read() on squeak.html:

==== squeak.html ====

  <html>
     <head>
       <title>Squeak!</title>
     </head>
     <body>
       <h1>Squeak!</h1>
       <span ID="message">squeak squeak squeak</span>
     </body>
   </html

==========

With selectNodes, I see the "Dynamic Sites indeed" message.

Thanks,
Thomas.


_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to