Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Append/Import XML from input - IE5-7 - Javascript >Thread Next - Re: Append/Import XML from input - IE5-7 - Javascript Re: Append/Import XML from input - IE5-7 - JavascriptTo: NULL Date: 3/12/2008 6:38:00 PM Woohoo... thank you both oFldXMl.documentElement worked. Seems so obvious now; when you know. All the best. On Mar 11, 8:53=A0pm, "Anthony Jones" <A...@yadayadayada.com> wrote: > "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote in message > > news:uFcXbf1gIHA.6032@T...... > > > > > > > "Ray Proffitt" <ray...@gmail.com> wrote in message > >news:b9c4fef8-5168-4b16-8f9d-3ac54393feae@s......= > > > Hi. > > > > I have an XML document: > > > <root> > > > <data> > > > <query> > > > <!--HERE--> > > > </query > > > </data> > > > </root> > > > > And I need to insert an XML node with children where <!--HERE--> is. > > > I know how to get the <query> node, but I can't figure out how to > > > insert my node object. > > > An input field will contain the following: <Where><Contains><FieldRef > > > Name=3D"Test"/><Value Type=3D"Text">Tester</Value></Contains></Where> > > > > I parse this using "MSXML2.DOMDocument.3.0", and try and insert the > > > XMLDom object as a child of <query>. > > > > I've tried using: > > > 1.- The text property of the <query> node, but that escapes the XML > > > and it's treated as text. > > > 2.- queryNode.appendChild(oFldXml) =3D the operation cannot be perform= ed > > > with a node of type document. > > > 3.- queryNode.importNode(oFldXml, true) =3D Method not supported. > > > > Any advice would be really appreciated. > > > > Thanks. > > If you are using version 3.0 then you need cloneNode: > > > queryNode.appendChild(oFldXml.documentElement.cloneNode(true)) > > Since the oFldXml DOM has been created for the sole purpose of parsing som= e > XML from a string and then inserting the results into another DOM its most= > likely that oFldXml will be discarded soon after. =A0Hence the cloneNode(t= rue) > is most likely unnecessary. =A0Just oFldXMl.documentElement would do. > > -- > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text - > > - Show quoted text - | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
