tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Ansorg <li...@ja-web.de>
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
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message