- From: Renjith K.V <renjith@iceindia.com>
- Date: Tue, 04 Feb 2003 17:57:42 +0530
- 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 UTC