1
Answer

How to create XML attribute name with special character:

jeya pandi

jeya pandi

6y
1.1k
1
Hi,
 
i am using a XMLDocument to generate a XML file and some elements have an attribute name containing the caracter ":".
 
The code is:
 
elem = xmldoc.CreateElement("Livraria");
elem.SetAttribute("Nome:XPTO", "TESTESARA");
elem.SetAttribute("Local", "Braga");
xmldoc.DocumentElement.AppendChild(elem);
 
In the XML file generated the attribute name is only XPTO and i wanted it to be Nome:XPTO.
 
Is this possible or is it a limitation of the framework?
 
Thanks in advance.
Answers (1)