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

update content of a node : tidylib

From: Renjith K.V <renjith@iceindia.com>
Date: Mon, 17 Feb 2003 15:44:46 +0530
Message-Id: <5.2.0.9.0.20030217153640.00ac8bd0@tvm.asianetindia.com>
To: html-tidy@w3.org



How to i update content of a node programatically with tidylib
( This is for adding more items to combo boxes in html
    my program added <option> node to select node. but i need to set 
content of <option> tag
   <option name = "contry"></option> should be made <option name = 
"contry">India</option>
)

I have added a node to Html DOM in following way
Also i need to update content of the Option  tag.

	if(tidyNodeIsSELECT(child))
	  {
   		AttVal *av;
		optNode = InferredTag( tdoc, "Option");
		av = NewAttribute();
		av->attribute = tmbstrdup("value");
		av->value = tmbstrdup("test");
		optNode->attributes = av;
		InsertNodeAtEnd(child, optNode);
	}

how can i do that ?

I have tried the following way but it gives me errors

optNode->type == TextNode;
optNode->content = tmbstrdup("oho whatz it ?");

please help me

Renjith.
Received on Monday, 17 February 2003 05:06:24 GMT

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