For example.
Are these xml tags acceptable or not.
<xml>
<3333>abc</3333>
<ab#$3>def</ab#$3>
</xml>
My question is can I create tags of integers values or a tag with Special characters ?
I tried this
FileStream fs = new FileStream((filename), FileMode.Append);
XmlWriter w = XmlWriter.Create(fs);
w.WriteStartElement("3454");
and got the following error
{System.ArgumentException: Invalid name character in '3454'. The '3' character, hexadecimal value 0x33, cannot be included in a name.
at System.Xml.XmlWellFormedWriter.CheckNCName(String ncname)
at System.Xml.XmlWellFormedWriter.WriteStartElement(String prefix, String localName, String ns)
at System.Xml.XmlWriter.WriteStartElement(String localName)
at WindowsFormsApplication1.Form1.fn_setMapping(SqlString keyString, SqlString column, SqlString value)
Thank You
An XML element name cannot start with a number, so
<3333>is not valid.As for which special characters are valid… see the spec for element names.
A valid name should start with a
NameStartCharfollowed by any number ofNameChar.