Hi there,
I am using the following code to creata a xml node with 5 attributes but I discover the last attribute is always missing. Can anyone help me to find out what is the problem?
=================================================================================
XmlDocument doc = new XmlDocument();
XmlNode node = doc.CreateElement("WORKER_ALLOCATION_OpenEpisode", NamespaceManager.LookupNamespace("d"));
XmlAttribute attr;
attr = doc.CreateAttribute("OpenEpisodeID");
node.Attributes.Append(attr);
attr = doc.CreateAttribute("WorkerAllocationID");
node.Attributes.Append(attr);
attr = doc.CreateAttribute("EpisodeNumber");
attr.Value = episodeNumber;
node.Attributes.Append(attr);
attr = doc.CreateAttribute("T2Team");
attr.Value = T2Team;
node.Attributes.Append(attr);
doc.CreateAttribute("PrimaryClinician");
attr.Value = primaryClinician;
node.Attributes.Append(attr);
doc.AppendChild(node);
====================================================
The xml content of variable doc is as follows and the last attribute, named "PrimaryClinician", is missing.
<WORKER_ALLOCATION_OpenEpisode OpenEpisodeID="" WorkerAllocationID="" EpisodeNumber="E001" T2Team="Don Murrphys" xmlns="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" />