DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 25 Jul 2007 07:57:35 -0400,    posted on: microsoft.public.dotnet.languages.jscript        back       

Thread Index
  1    lucius am
          2    (WenYuan Wang [MSFT])
          3    (WenYuan Wang [MSFT])
          4    (WenYuan Wang [MSFT])


Copy Element and Create New?   
I have an XML document that was a .NET DataSet originally, with schema
information at the top.

Could someone show how, using MSXML v2 "createobject", to copy an
element (that has n attributes) to a new element? Also, how to create
a new element so I can put new attribute data inside?

Thanks.
Date:Wed, 25 Jul 2007 07:57:35 -0400   Author:  

RE: Copy Element and Create New?   
Hello Lucius

We need to perform more research on this issue . We will reply here as soon 
as possible. 
If you have any more concerns on it, please feel free to post here. 

Thanks for your understanding! 
Best regards, 
Wen Yuan
Microsoft Online Community Support 
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Thu, 26 Jul 2007 08:18:16 GMT   Author:  

RE: Copy Element and Create New?   
Hello Lucius,
Thanks for your wait.

I think you need a JavaScript example in Web Application. Please correct me 
if I misunderstand anything here. Thanks. 

1) Using MSXML object to Copy an element, you may refer the following code.

var doc = new ActiveXObject("Msxml2.DOMDocument");
doc.loadXML("<?xml version=\"1.0\" 
encoding=\"utf-8\"?><root><a>aaaaa</a></root>");
var root = doc.documentElement;
var m = doc.selectSingleNode("/root/a").cloneNode(true);
root.appendChild(m);
alert(doc.xml);

2) Using MSXML object to create a new element: you may refer the following 
code.

var doc = new ActiveXObject("Msxml2.DOMDocument");
doc.loadXML("<?xml version=\"1.0\" 
encoding=\"utf-8\"?><root><a>aaaaa</a></root>");
var o = doc.createElement("newElement");
var r = doc.createAttribute("id");
r.value="test";
o.setAttributeNode(r);
root.appendChild(o);
alert(doc.xml);

Hope this helps. Please try the above method and let me know if this is 
what you need. We will follow up. 
Best regards,
Wen Yuan
Microsoft Online Community Support 
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Thu, 26 Jul 2007 11:56:44 GMT   Author:  

RE: Copy Element and Create New?   
Hello Lucius,

This is Wen Yuan. I just want to check if there is anything we can help 
with.
Have you resolved the issue so far?
Please feel free to update here if you have any concern. We are glad to 
assist you.

Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support 
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Mon, 30 Jul 2007 11:13:42 GMT   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us