I have an app that writes to XML. If a text box is filled, then I write that value to the XML doc.
writer.WriteStartElement("VEHICLE_LICENSE_NUMBER") '10-28
writer.WriteString(frmCitation.txtPlate.Text.ToString)
writer.WriteEndElement()
If TEST123 is the value in the text box, this is the result.
<VEHICLE_LICENSE_NUMBER>TEST123</VEHICLE_LICENSE_NUMBER>
Question is, if that value in the textbox is empty, and not filled in, how do I not even have that line appear in the XML? I'd like it to disappear unless there's a value.
Does anyone have any ideas?