Ok I have some code here from C#. If want to modify it so that if "sid' contains the special character "&" it will stop running the process instead of continuing on and writing the xml file. Can anyone help me with this?
Code:
sid = loc_url.Substring(index, loc_url.Length - index);
(so basically, if sid contains "&" anywhere in it, end the program here instead of continuing below.)
XmlDocument doc = new XmlDocument();
XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
doc.AppendChild(docNode);
XmlNode chunkDataNode = doc.CreateElement("ChunkData");
doc.AppendChild(chunkDataNode);
XmlNode fieldNode = doc.CreateElement("fields");
chunkDataNode.AppendChild(fieldNode);
XmlNode field6Node = doc.CreateElement("field6");
field6Node.AppendChild(doc.CreateTextNode(sid));
fieldNode.AppendChild(field6Node);
Comment