Hi,
This might be a stupid question, but are you sure there's an element
whose ID is "content" ?

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Jens Ansorg [mailto:[EMAIL PROTECTED]
>Sent: Monday, July 26, 2004 8:48 AM
>To: [EMAIL PROTECTED]
>Subject: [5.0.27] org.w3c.dom.Document.getElementById() not working -
>worked with Resin-2.11
>
>hi,
>
>I have a class that reads XHTML files and deals with them as dom
document.
>    javax.xml.parsers.DocumentBuilderFactory factory =
>DocumentBuilderFactory.newInstance();
>    javax.xml.parsers.DocumentBuilder builder =
>factory.newDocumentBuilder();
>    org.w3c.dom.Document doc = builder.parse(new File(getUrl()));
>
>
>one method tries to get a certain element in this dom
>    org.w3c.dom.Element contentElement = doc.getElementById("content");
>
>unfortunately this code fails, contentElement is always null.
>
>
>another method grabs all Anchors and deals with them
>    org.w3c.dom.NodeList links = doc.getElementsByTagName("a");
>    for (int i = 0; i < links.getLength(); i++)
>    {
>        org.w3c.dom.Node link = links.item(i);
>        //... do something useful ...
>    }
>
>this code works!
>
>
>
>the class runs fine on a Resin Server but fails on Tomcat 5.0.27
>
>
>
>any ideas how to get this working on tomcat?
>
>
>thanks
>Jens
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to