Showing posts with label XML Attribute. Show all posts
Showing posts with label XML Attribute. Show all posts

Friday, September 11, 2009

The ' ' character, hexadecimal value 0x20, cannot be included in a name

While creating XElement or XMLElement from C# code,
probably you will get below error

Error:
The ' ' character, hexadecimal value 0x20, cannot be included in a name.

Solution:
XElement/attribute does not contain space between node name, make sure your node name doesn't have white spaces.

for example

<Row Total Cost="" />

change to
<Row TotalCost="" />


if you notice second one there is no white space on Attribute TotalCost


hope this helps