Re: update Script section of html from tidylib.

That function is usefull for me ,
I have set the value of an attribute of the node by NOT using public 
interfaces.

How can i set the value of a node ?

Note that even though public functions are not available i have set value 
to attribute of a node by following way ,
how can i apply this technique for our problem ?
Which structures which member variable should be updated ?

AttVal *controlVal;
controlVal = GetAttrByName(child, "value");
controlVal->value = "renjith";


Renjith.

At 10:48 AM 2/12/2003 -0500, you wrote:
>There was just a long thread about this.
>
>My suggestion: tidyNodeGetText().
>
>Problem 1: there is not way to _update_ a node in the public 
>interface.  But I thought you knew this.
>
>Problem 2: Your code may run into trouble if it is run on the same file 
>more than once.  I.e. you will add the same function every time.  So you 
>may still want to use a regular expression - or at a minimum strstr() - to 
>make sure the function is not already present.
>
>At 10:24 AM 2/12/2003 +0530, Renjith K.V wrote:
>
>>My idea is like this , but i didn't get enough functions for that ,
>>get the content of scripts ( content between  <SCRIPT> and </SCRIPT> ) 
>>and append my function and update to SCRIPT node.
>>
>>How can i get value of a node ?. ( like we can get value an attribute )
>>
>>looking forward for a positive reply.
>>
>>Renjith.
>>
>>At 10:17 AM 2/11/2003 -0500, you wrote:
>>>Great question.  One thing Tidy is _not_, nor will it become in the 
>>>foreseeable future, is a Javascript parser.  That said, I think you 
>>>could do what you want much more easily with a Regex library and by 
>>>separating the Javascript from the markup.  Thus, my lo-tek(tm) 
>>>suggestion, would be to keep your Javascript in a separate file, which 
>>>you can generate as needed using your own code.
>>>
>>>hth,
>>>Charlie
>>>
>>>At 12:53 PM 2/11/2003 +0530, Renjith K.V wrote:
>>>
>>>>I need to update script section of the html through the tidylib
>>>>for eg.
>>>>
>>>><SCRIPT language=JavaScript1.2>
>>>>function funct1()
>>>>{
>>>>}
>>>></SCRIPT>
>>>>
>>>>should be updated to
>>>>
>>>><SCRIPT language=JavaScript1.2>
>>>>function funct1()
>>>>{
>>>>}
>>>>function new_function()
>>>>{
>>>>}
>>>></SCRIPT>
>>>>
>>>>ie I need to add one more function programmatically to script section 
>>>>of html document .
>>>>
>>>>can i use function
>>>>tidyNodeIsSCRIPT(
>>>><structTidyNode.htm>TidyNode tnod ); and proceed
>>>>please help me
>>>>
>>>>
>>>>
>>>>Renjith.

Received on Thursday, 13 February 2003 05:04:41 UTC