RE: [xmljs-users] deep copy nodes between xml documents with JS
Brought to you by:
djoham,
witchhunter
From: Barry B. <Ba...@al...> - 2004-12-14 05:53:11
|
ah ha! now I'm cooking! thankyou James (and also David) xmlFragment =3D parser.loadXML(xmlToAdd.xml.toString()); where "xmlToAdd" is the ActiveX xml doc and the parser is the w3c vers (I gave up on the classic - sorry) all I gotta do is turn "xmlFragment" (not a real DocumentFragment yet) into something I can insert into the master=20 there isn't really a copyNode(deep) or insertFragment(node) is there... ...any suggestions? perhaps loop over each xmlFragment.ChildNodes and .attributes, adding them to the master (using createTextnode, createAttribute, etc)? thank heaps barry.b PS: [James and David:] the penny has (finally) dropped re: diff xml implementation, so much so that (later) I'll convert the ActiveX version to the W3C version as soon as the xnlhttprequest retrieves the data (at the moment I'm doing it before populating the form - my bad). I'll do the same with the firefox version when I get that working. -----Original Message----- From: xml...@li... [mailto:xml...@li...] On Behalf Of James S. Elkins Sent: Tuesday, 14 December 2004 2:25 AM To: David Joham; xml...@li...; Barry Beattie Subject: Re: [xmljs-users] deep copy nodes between xml documents with JS Barry, Try dumping the DOM obtained via XmlHttpRequest to an XML string and then=20 loading the XML into a new document in <XML for Script> to get it into the=20 proper implementation. ;) Thanks, James At 10:14 AM 12/13/2004, you wrote: > > the xmlhttprequest *has* to be there - it's providing lookup data that=20 > gets displayed in a form > > for editing (think remote procedure calls). > >There's no reason why you can't use xmlhttprequest and XML for <SCRIPT> at=20 >the same time, is >there? It should be possible to use xmlhttprequest and simply insert the=20 >resulting xml string from >the request object into an XML for SCRIPT DOM object. Standardizing on a=20 >single DOM Implementation >should get you past this and will likely prevent a whole host of other=20 >problems later. Since the >API of the two dom objects should be pretty much the same, it shouldn't >even require much (if any) >rework on your part. > >You could also look into the xmlIO functions of XML for <SCRIPT> to get >your XML String from the >server and do your RMI. However, if you're using browsers that you know >support xmlhttprequest, >I'll be the first to admit that object does provide a more robust API and=20 >less hoops to jump >through. > > > > > As each lookup happens I have to store the previous changes somewhere=20 > (the master doc?) and then > > post that as one hidden field back to the server for processing. The > master doc basically > > provides a new root node and some id attributes, ready to be filled=20 > with child nodes from the > > xmlhttprequest doc. > > > >Again, the master doc should just be an XML for SCRIPT DOM object > > > now I'm really stuck. any ideas on how I can aggrigate the results of=20 > each lookup (ie: add > > nodes) to send back to the server in one hidden form field? looks like=20 > the data island idea > > won't work.... > >xmlhttprequest should be fine here, as long as you use it just for data >retrieval. If you're >talking xml data islands (the IE proprietary thing) I think maybe you're=20 >making things harder for >yourself than you have to. > >Is there some reason you can't post some simple source code to help us=20 >help you out? A very simple >recreation that outlines what you're trying to do will go a long way in >helping us understand your >environment. > > > > > (in panic mode) > > > >Don't panic, find your towel and post some source code :) > >David ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.=20 http://productguide.itmanagersjournal.com/ _______________________________________________ xmljs-users mailing list xml...@li... https://lists.sourceforge.net/lists/listinfo/xmljs-users |