Re: tidyRelease() ,

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 UTC