W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2003

Re: tidyRelease() ,

From: Charles Reitzel <creitzel@rcn.com>
Date: Tue, 04 Feb 2003 10:08:34 -0500
Message-Id: <4.3.2.7.2.20030204100338.02994868@pop.rcn.com>
To: "Renjith K.V" <renjith@iceindia.com>
Cc: html-tidy@w3.org

Hi Renjith,

Your dump() function looks OK.  The check for a NULL node shouldn't be 
necessary, as you wouldn't have entered the loop without a non-NULL value, 
right?  So the problem is somewhere else.

If you do a debug build, it should be possible to find out which function 
beneath tidyRelease() is causing the problem.  Also, what is your compiler 
and platform?

take it easy,
Charlie

P.S.  So far, TidyLib is still read-only.  Or have you added some update 
routines?  Curious.

At 05:57 PM 2/4/2003 +0530, Renjith K.V wrote:


>Using Html tidy lib i have created a program
>  to parse an html file,
>  to get name of input form controls
>  to update values to form controls ,
>and reproduce updated html file.
>
>TidyDoc tdoc = tidyCreate();
>status = tidyParseFile( tdoc, htmlfil );
>//Walk through each node of Tidy doc and get input form controls and 
>update values
>dump(tidyGetBody(tdoc),node);
>tidyRelease( tdoc );
>
>Now my problem is that tidyRelease( ); blows frequently.
>if tidyRelease( ) is commented it works nicely.
>
>here is my code for walking through nodes.
>
>
>void dump(TidyDoc tdoc,TidyNode childNode)
>{
>         TidyNode child;
>    for ( child = tidyGetChild(childNode); child; child = tidyGetNext(child) )
>    {
>           AttVal *controlVal;
>           AttVal *controlName;
>           if(tidyNodeIsINPUT(child))
>           {
>                   controlName = GetAttrByName(child, "name");
>                   controlVal = GetAttrByName(child, "value");
>                   if(!(controlVal==null))
>                   {
>                         controlVal->value = "Renjith";
>                   }
>                   else
>                   {
>                         AddAttribute( tdoc, child, "value", "renjith" );
>                   }
>
>           }
>
>      //assert( child != NULL );
>           if(child == null)
>                 continue;
>         dump(tdoc,child);
>         }
>
>
>}
Received on Tuesday, 4 February 2003 10:00:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:53 GMT