1
public class UName
{
   [XmlElement("0.23")]
   public string Name1{get;set;}


}

when serialize above object then generated as below

  <UName><_x0030_.23>value</_x0030_.23></Uname>

I need as below as provided attribute number:

<UName><0.23>value</0.23></Uname>
Cœur
  • 37,241
  • 25
  • 195
  • 267
dsi
  • 3,199
  • 12
  • 59
  • 102
  • You cannot do that. An XML element name beginning with a number is syntactically invalid. See http://stackoverflow.com/q/2087108/3744182 or http://stackoverflow.com/q/2519845/3744182 – dbc Apr 07 '17 at 05:56

1 Answers1

1

What you want is not valid XML. Element names must start with a letter or underscore.

See https://www.w3.org/TR/REC-xml/#NT-NameStartChar

Richard Schneider
  • 34,944
  • 9
  • 57
  • 73