Writing Special Chars in Xml Tag ( Google Product Xml Feed )

bkforlifeiiii

New Member
I'm working on google product feed xml with C#I can generate a xml with using XmlSerializer but I can't solve just one problem;In xml feed example, product id has to be like this;\[code\] ... <item> <title>Super item</title> <link>http://www.bla.com/13007/2202170/</link> <description>Test description</description> <g:id>1234678</g:id> </item> ... \[/code\]But as you can see special " : " char in xml element tag.So when I write "[XmlElement("g:id")]" on my property like; \[code\] [DataMember] [XmlElement("g:id")] public int Id { get; set; }\[/code\]XmlSerializer generetad my xml tag like; < g_X003A_id >And generated xml looking like this;\[code\]...<item> <title>Super item</title> <link>http://www.bla.com/13007/2202170/</link> <description>Test description</description> <g_X003A_id>1234678</g_X003A_id></item>... \[/code\]How can I solve this problem ?
 
Back
Top