Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Add or insert records to XML Repeating Sequence Group › Add or insert records to XML Repeating Sequence Group
[quote:e1971f0488=\”nwalters\”]The two methods that come to mind first are doing it with text/strings/stringBuilder or with XmlDocument (and maybe a C# helper class).
Where I work, they have a C# helper class with a static method called AddChildDocument:
The C# code is relatively simple:
[code:1:e1971f0488] public static XmlDocument AddChildDocument(
XmlDocument parentDocument,
XmlDocument childDocument,
string parentElementName,
string parentNamespace)
{
XmlElement rootElement = null;
XmlNode childRoot = null;
XmlNodeList nodeList = null;
if (parentDocument != null && childDocument != null)
{
nodeList = parentDocument.GetElementsByTagName(parentElementName, parentNamespace);
if (nodeList != null & nodeList.Count > 0)
{
rootElement = (XmlElement)nodeList.Item(0);
if (rootElement != null)
{
childRoot = childDocument.DocumentElement;
rootElement.InnerXml = rootElement.InnerXml + childRoot.OuterXml;
}
}
}
return parentDocument;
}[/code:1:e1971f0488][/quote:e1971f0488]
Hi [color=darkblue:e1971f0488][b:e1971f0488]nwalters[/b:e1971f0488][/color:e1971f0488],
I have the same problem than [color=darkblue:e1971f0488][b:e1971f0488]joswalt[/b:e1971f0488][/color:e1971f0488]…
Your [i:e1971f0488]C#[/i:e1971f0488] code seems to be useful, but where do you put it ? In a [i:e1971f0488]scripting functoid[/i:e1971f0488] in the [i:e1971f0488]BizTalk mapper[/i:e1971f0488] ?
If yes, how can you connect that scripting functoid between source and destination schema ?
I can’t understand…
Thanks a lot if you can help me on that point.