If you have two sections (sections can have anything including file controls) and you want to copy content from one section to another, here is how you do it:
string sourceXPath = "/my:myFields/my:Source";
string destXPath = "/my:myFields/my:Destination";
XPathNavigator source = this.CreateNavigator().SelectSingleNode(srcXPath, this.NamespaceManager);
XPathNavigator dest = this.CreateNavigator().SelectSingleNode(destXPath, this.NamespaceManager);
XPathNavigator dest = this.CreateNavigator().SelectSingleNode(destXPath, this.NamespaceManager);
if (dest.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
dest.DeleteSelf();
dest.DeleteSelf();
if (source.InnerXml.Contains("xsi:nil="))
{
//Do nothing
}
else
{
if (dest.InnerXml.Contains("xsi:nil="))
{
dest.InnerXml = source.InnerXml;
}
else
{
dest.InnerXml += source.InnerXml;
}
{
//Do nothing
}
else
{
if (dest.InnerXml.Contains("xsi:nil="))
{
dest.InnerXml = source.InnerXml;
}
else
{
dest.InnerXml += source.InnerXml;
}
No comments:
Post a Comment