document.getElementsByTagName("params").item(0).appendChild(document.createElement("param");
hope this help
Marc
Andrew MacDonald a �crit :
Hello, I'm using CForms to edit an XML file, but can't figure out how to insert a unique node when saving the document.
Here is what the default doc looks like: ========================== <?xml version="1.0"?> <tool> <toolDetails> <toolName>tool</toolName> <toolDescription>description</toolDescription> <endpointURL>URL</endpointURL> <serviceURI>URI</serviceURI> <serviceMethod>method</serviceMethod> </toolDetails> <params> <param id="1"> <label/> <paramName/> <value/> <soapType/> <defaultValue/> <display/> <listItems> <listItem id="1"> <label>preset1</label> <value>preset1</value> </listItem> <listItem id="2"> <label>preset2</label> <value>preset2</value> </listItem> </listItems> </param> </params> </tool> ==================== Basically I want to insert a new <param> node (and increase the id value for it). Currently when use the form.save(doc) method it overwrites the first <param>. I've been trying to specify the last <param> node in my binding file but get a "JXPath can only create a path if it uses exclusively the child:: and attribute:: axes and has no context-dependent predicates" error, so I'm assuming something like "<fb:value id="label" path="param[last()]/label"/>" will not work.
Oh, and although I'm using a repeater for <listItems> I can't use that for <params> due to the way the forms are set up.
Any help would be greatly appreciated!
Thanks, Andrew MacDonald
__________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
