[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How To Modify the Contents Of XML Document Dynamically?
Hi, You need to learn how to use the DOM to manipulate your XML file. <Description/> is fine in your original XML file. Use getElementsByTagName("NOTE") to get all of your <NOTE> elements Then use something like: '<input type=text name=description>'+root.childNodes(x).childNodes(3).text+'</input>' Where 'x' is a variable to iterate through you <NOTE> elements, outputting an editable box for each description element. The put whatever the user types back into the element: root.childNodes(x).childNodes(3).text=yourForm.description.value; finally, save the new XML back to a file: yourXmlDoc.save('yourfile.xml') For this to be allowed, you need to rename the .htm that instigates the transform to .hta This will allow the necessary permissions. I know I have been overly brief, bu if you get stuck I can give you some more help. cheers andrew === -----Original Message----- From: - - [mailto:kerroppa@h...] Sent: Friday, January 11, 2002 12:41 AM To: mc@x...; xml-dev@l... Subject: Re: How To Modify the Contents Of XML Document Dynamically? Thanks Mike, Say, I change <DESCRIPTION /> to <DESCRIPTION>the description goes here</DESCRIPTION>. When this XML is displayed with XSL nicely, the viewer should be allowed to change the text of <DESCRIPTION> (In this case, the viewer modifies from "the description goes here" to "this has been modified." ) so that next time the same XML is displayed, it'll show as "this has been modified" instead of "the description goes here"... Is this possible? Thanks, kero >From: Mike Champion <mc@x...> >To: - - <kerroppa@h...> >Subject: Re: How To Modify the Contents Of XML Document >Dynamically? >Date: Thu, 10 Jan 2002 19:24:10 -0500 > >I'm not sure what you mean. DESCRIPTION is an "empty tag" >in your example. That is useful if you want to assign attributes >to an element but not give it content. Perhaps you want to change it to ><DESCRIPTION>the description goes here</DESCRIPTION> > >XML does not say anything about what is modifiable by >some program displaying it, that's totally up to the application. > > > >1/10/2002 7:10:48 PM, "- -" <kerroppa@h...> wrote: > > >Hi all, > > > >I'm fairly new with XML so please bare with me ;o) > > > >Let's say I have following XML: > > > >... > ><NOTE> > > <NAME> xxx </NAME> > > <DATE> ddd </DATE> > > <DESCRIPTION /> > ></NOTE> > >... > > > >When this is displayed in the browser using XSL, I would like to make the > ><DESCRIPTION /> part of this XML modifiable to viewers. And also, after > >modifying this section, this XML should take the input and store it into >the > >XML file (itself). > > > >I heard this can be done, but I just can't find the information to > >accomplish it. I really appreciate any of your inputs. > > > >Thanks in advance, > >kero > > > >_________________________________________________________________ > >MSN Photos is the easiest way to share and print your photos: > >http://photos.msn.com/support/worldwide.aspx > > > > > >----------------------------------------------------------------- > >The xml-dev list is sponsored by XML.org <http://www.xml.org>, an > >initiative of OASIS <http://www.oasis-open.org> > > > >The list archives are at http://lists.xml.org/archives/xml-dev/ > > > >To subscribe or unsubscribe from this list use the subscription > >manager: <http://lists.xml.org/ob/adm.pl> > > > > > _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx ----------------------------------------------------------------- The xml-dev list is sponsored by XML.org <http://www.xml.org>, an initiative of OASIS <http://www.oasis-open.org> The list archives are at http://lists.xml.org/archives/xml-dev/ To subscribe or unsubscribe from this list use the subscription manager: <http://lists.xml.org/ob/adm.pl>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|