i checked many threads that have the same title but all of them are demo different problem than mine. so if i was wrong, can someone to point me to right thread.
i'm building my own SAX XML parser beside the test tool that will used to send XML file to the parser then the test tool will receive the fired event from SAX parser to reconstruct the XML and to be compared with transmitted one to verify the proper operation of parser.
anyway, i'm using oasis test cases, especially (o-p04pass1)
<doc>
<abcdefghijklmnopqrstuvwxyz/>
<ABCDEFGHIJKLMNOPQRSTUVWXYZ/>
<A01234567890/>
<A.-:̀·/>
</doc>
so to reconstruct <A.-:̀·/>
, i'm using the following C# code and i'm getting exception System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a name. with the following line
currentXMLElement = new XElement(startString[0], "");
startString[0] will contain A.-:̀·
which will cause the exception.
my questions are:
- the : is one of accepted character in the name according to the latest standard https://www.w3.org/TR/xml/#NT-NameStartChar, so why i'm getting the exception?
- Am using the correct function to reconstruct the XML, and if not, what is best way to do it?
Thanks, Mohammed Fawzy