R
raghudr
<?xml version="1.0" standalone="yes" ?>
- <AddressSpace xsi:noNamespaceSchemaLocation="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:noNamespaceSchemaLocation="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.DocumentElement.GetAttribute("xsi:noNamespaceSchemaLocation".ToString());
string strName =
xdoc.DocumentElement.GetAttribute("Name".ToString());
string strConfigMax =
xdoc.DocumentElement.GetAttribute("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:noNamespaceSchemaLocation="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:noNamespaceSchemaLocation="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.DocumentElement.GetAttribute("xsi:noNamespaceSchemaLocation".ToString());
string strName =
xdoc.DocumentElement.GetAttribute("Name".ToString());
string strConfigMax =
xdoc.DocumentElement.GetAttribute("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