RE: JTidy removing attributes when tidying up a HTML page

I don't know about removing the id attributes. 

However as far as I know, if the document object is the a result of the jtidy you can't get an element by using getElementById(). This is because getElementById is a DOM level 2 function. While jtidy only supports DOM level 1 function. More info check the org.w3c.dom.Document in the API documentation.

You should be able to however iterate through all attributes (unless you also use a DOM level 2 function to iterate through the attribute). 

--- Begin Orginal Message ---
From: "Dirk Weigenand" <Dirk.Weigenand@smb-tec.com>
To:   <html-tidy@w3.org>
CC: 
Date: 1/8/2004 1:54:00 PM


Hi,

i already tried on the jtidy mailing list on sourceforge but have got no
response so far. So i'm reposting my question on this list:

I'm using JTidy in conjunction with HTTPUnit for some web testing.

When i get the DOM from HTTPUnit (WebConversation.getCurrentPage().getDOM())
and then look up an Element by id (either by document.getElementById() or via
iterating over the DOM and inspecting the attributes of each element) all id
attributes are removed.

Is this something one can change via a configuration option or can give me
someone a hint as to the deeper reasons behind this problem?

regards,
        Dirk
-- 
_____________________________________________________________________
Dirk Weigenand                      mailto:Dirk.Weigenand@smb-tec.com
SMB GmbH                                       http://www.smb-tec.com


--
Reza Ferrydiansyah
SHRS University of Pittsburgh
ref11@pitt.edu

Received on Thursday, 8 January 2004 10:47:15 UTC