I want to create something like this at run-time:
<CWS>
<Case name="10-040-00022">
<CaseDetailsSet>
<CaseDetail title="Patient name" />
<CaseDetail title="Date of birth" />
</CaseDetailsSet>
</Case>
</CWS>
so I wrote something like this ( I wish to use DOM in .NET .. not the XMLWriter,etc)
XmlDocument doc = new XmlDocument();
XmlElement root = doc.CreateElement("CWS");
XmlElement singleCase = doc.CreateElement("Case");
root.AppendChild(singleCase);
singleCase.SetAttribute("name", "10-040-00022");
XmlElement CaseDetailsSet = doc.CreateElement("CaseDetailsSet");
singleCase.AppendChild(CaseDetailsSet);
XmlElement CaseDetail = doc.CreateElement("CaseDetail");
CaseDetailsSet.AppendChild(CaseDetail);
CaseDetail.SetAttribute("title", "Patient Name");
please have a look at it and tell me if I am oing something wrong , regardign the code I worte to create that structure above.
much appreciated.