<?xml version="1.0" standalone="yes " ?>
- <AddressSpace xsi:noNamespace SchemaLocation= "prince.xsd " Name="U2"
ConfigMax="1" xmlns:xsi="http ://www.rag.org/2001/XMLSchema-instance">
<Item Name="raj" VALUE="60864"/>
<Item Name="rag" VALUE="60868" />
</AddressSpace>
Hi all,
I have a .xml file like this.I have to do lot of operations by reading
comparing and copying some data to other files like that.
Now my problem i am struck:- I want to copy the full Root element and
put it in another .xml file
<AddressSpace xsi:noNamespace SchemaLocation= "prince.xsd " Name="U2"
ConfigMax="1" xmlns:xsi="http ://www.rag.org/2001/XMLSchema-instance">
root element i want to copy
I can do it this way
string strfiletype =
xdoc.DocumentEl ement.GetAttrib ute("xsi:noName spaceSchemaLoca tion".ToString( ));
string strName =
xdoc.DocumentEl ement.GetAttrib ute("Name".ToSt ring());
string strConfigMax =
xdoc.DocumentEl ement.GetAttrib ute("ConfigMax" .ToString());
....
and then use setattribute to write to a new .xml file.
But my rootelement keeps chnaging and all the times it is may not
know the attribute name
hence i want to copy whole rootelement without using any names and put
it in a new .xml file.
please help me on this
thanks in advance
RAGHU
- <AddressSpace xsi:noNamespace SchemaLocation= "prince.xsd " Name="U2"
ConfigMax="1" xmlns:xsi="http ://www.rag.org/2001/XMLSchema-instance">
<Item Name="raj" VALUE="60864"/>
<Item Name="rag" VALUE="60868" />
</AddressSpace>
Hi all,
I have a .xml file like this.I have to do lot of operations by reading
comparing and copying some data to other files like that.
Now my problem i am struck:- I want to copy the full Root element and
put it in another .xml file
<AddressSpace xsi:noNamespace SchemaLocation= "prince.xsd " Name="U2"
ConfigMax="1" xmlns:xsi="http ://www.rag.org/2001/XMLSchema-instance">
root element i want to copy
I can do it this way
string strfiletype =
xdoc.DocumentEl ement.GetAttrib ute("xsi:noName spaceSchemaLoca tion".ToString( ));
string strName =
xdoc.DocumentEl ement.GetAttrib ute("Name".ToSt ring());
string strConfigMax =
xdoc.DocumentEl ement.GetAttrib ute("ConfigMax" .ToString());
....
and then use setattribute to write to a new .xml file.
But my rootelement keeps chnaging and all the times it is may not
know the attribute name
hence i want to copy whole rootelement without using any names and put
it in a new .xml file.
please help me on this
thanks in advance
RAGHU
Comment