RE: [xmljs-users] Cannot write back to root document object...
Brought to you by:
djoham,
witchhunter
From: Eljon G. <eg...@re...> - 2004-07-29 18:20:37
|
Sure, Here is an example of the code: function removeNode(tElement,tOrder){ if(pageRoot.getElementsByTagName(tElement).item(tOrder-1) !=3D null) { =20 tNode =3D pageRoot.getElementsByTagName(tElement).item(tOrder-1); // Get first element by node name (i.e. section, fieldgroup, fields)=20 =09 tNode.getElementsByTagName('active').item(0).setNodeValue("No"); // Set active element to "No" try { =09 alert(tNode.getElementsByTagName('active').item(0).getNodeValue()); // Displays "No" =09 alert(tNode.getElementsByTagName('active').item(0).getXML()); // Displays <active>Yes</active> =09 } catch(e) { // Catch any exception if(e.code =3D=3D DOMException.NO_MODIFICATION_ALLOWED_ERR) { // display the error message=20 alert("XML Exception Error: Code not remove " + tElement + "."); } else { alert("Unknown exception"); alert(e.code);=20 } } } else { alert("Null object"); }=09 } Thanks for your assistance. Eljon -----Original Message----- From: xml...@li... [mailto:xml...@li...] On Behalf Of David Joham Sent: Thursday, July 29, 2004 11:33 AM To: Eljon Greene; xml...@li... Subject: Re: [xmljs-users] Cannot write back to root document object... Hi Eljon! Can you whip up a quick recreation of the problem you're seeing please? I'll take a look and see what's up... David --- Eljon Greene <eg...@re...> wrote: > Hey guys, >=20 > I am new to XML for <script>. Everything is coming along pretty good=20 > except for one thing...That is trying to write back to the parent=20 > document node so that I can save this information on the server. I=20 > can use "DOMNode.setNodeValue()" and then use "DOMNode.getNodeValue()" > and it works. However when I try "DOMNode.getXML()" the old value=20 > still exists...I am trying to use global variables in my method=20 > instead of the local variables. What am I doing wrong and how do I=20 > write back to the "DOMDocument"? Thanks... >=20 >=20 > Eljon Greene > Web Software Engineer > 877.394.5644 \\ main > 904.567.2127 \\ direct > eg...@re... > www.recruitmax.com >=20 ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ xmljs-users mailing list xml...@li... https://lists.sourceforge.net/lists/listinfo/xmljs-users |