XmlElement updateRecipient = doc.CreateElement("UpdateRecipient"); XmlElement email = doc.CreateElement("EMAIL"); XmlElement listID = doc.CreateElement("LIST_ID"); XmlElement column = doc.CreateElement("COLUMN"); XmlElement name = doc.CreateElement("NAME"); XmlElement value = doc.CreateElement("VALUE") root.AppendChild(body); body.AppendChild(updateRecipient); updateRecipient.AppendChild(listID); listID.InnerText = _listID; updateRecipient.AppendChild(email); email.InnerText = _email; updateRecipient.AppendChild(column); column.AppendChild(name); name.InnerText = _columnNameFrequency; column.AppendChild(value); value.InnerText = _actionID.ToString(); updateRecipient.AppendChild(column); column.AppendChild(name); name.InnerText = _columnNameStatus; column.AppendChild(value);
for some reason, I get only one additional column instead of two under the updateRecipient element. I need them to appear in UpdateRecipient Node as follows:
<UpdateRecipient> <LIST_ID>85628</LIST_ID> <EMAIL> somebody@domain.com </EMAIL> <COLUMN> <NAME>Frequency</NAME> <VALUE>1</VALUE> </COLUMN> <COLUMN> <NAME>Status</NAME> <VALUE>Opted In</VALUE> </COLUMN> </UpdateRecipient>
but so far I get only one:
<UpdateRecipient> <LIST_ID>85628</LIST_ID> <EMAIL> somebody@domain.com </EMAIL> <COLUMN> <NAME>Status</NAME> <VALUE>Opted In</VALUE> </COLUMN> </UpdateRecipient>
When it falls into the first AppendChild (column), and then the name and value, the frequency shows find, but then is later redefined by status, and I want it to just add a new one under and I'm sure why it redefines and not adds another tag.
source share