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

tidyRelease() ,

From: Renjith K.V <renjith@iceindia.com>
Date: Tue, 04 Feb 2003 17:57:42 +0530
Message-Id: <5.2.0.9.0.20030204174817.00a66600@tvm.asianetindia.com>
To: html-tidy@w3.org


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 07:21:43 GMT

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