In the process of testing a method that accepts a string and adds that string as an attribute to an XElement (with the current time as a value). To use XElement.SetAttributeValue(XName name, object value)
(the only way I'm aware of to add/update an attribute of an XElement), I'm using XName.Get
to convert the provided string to an XName.
The problem I'm running into is that XName.Get (stack trace shows it is coming from System.Xml.XmlConvert.VerifyNCName
) is throwing an XmlException in some cases, claiming certain characters aren't allowed. One example is 0x02FF (˱). I wouldn't have expected that this character is allowed, but the XML specification seems to say the whole range of 0x00F8 to 0x02FF is valid.
Am I getting this exception on valid characters, or am I misunderstanding the spec?