.SetAttribute omitting part of attribute's prefix string name



I am setting a basic attribute using the XmlElement function SetAttribute(string name, string value).


It appears that my attribute is not fully set. Part of the string name is omitted and I cannot figure it out. I have changed the order of setting the attribute and appending the element but it has no effect. Additionally, in my root, I set an attribute with a similar name style and it works no problem. What am I missing?



C#:



//"xmlns:xsi" sets correctly
XmlElement root = docOut.CreateElement("UpdateRequest");
docOut.AppendChild(root);
docOut.DocumentElement.SetAttribute("xmlns:xsi", "http://ift.tt/ra1lAU");

//"xsi:type" : 'xsi:' is omitted in output.
XmlElement objects = docOut.CreateElement("Objects");
root.AppendChild(objects);
objects.SetAttribute("xsi:type", "DataExtensionObject");


Output:



<UpdateRequest xmlns:xsi="http://ift.tt/ra1lAU">
<Objects type="DataExtensionObject">
</Objects>
</UpdateRequest>


Why is this happening?


Thanks.


No comments:

Post a Comment