tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Ansorg <>
Subject [5.0.27] org.w3c.dom.Document.getElementById() not working - worked with Resin-2.11
Date Mon, 26 Jul 2004 12:48:27 GMT

I have a class that reads XHTML files and deals with them as dom document.
    javax.xml.parsers.DocumentBuilderFactory factory = 
    javax.xml.parsers.DocumentBuilder builder = 
    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?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message