mercredi 12 novembre 2014

Newtonsoft Json: How do I remove the @ put in front of each attribute


Vote count:

0




I am using Newtonsoft.Json.Net40. When I covert the following XDocument to Json the succeeding Json is returned.


< lsems-Response version="1.0.0" >

< lsems-Status statusCode="000" statusText="Success" >Store Data Request accepted.< /lsems-Status >

< lsems-StoreDataResponse >< /lsems-StoreDataResponse >

< / lsems-Response >


{"?xml":

{"@version":"1.0","@encoding":"UTF-8"},

"lsems-Response":

{

"@version":"1.0.0","lsems-Status":

{"@statusCode":"000","@statusText":"Success","#text":"Store Data Request accepted."},

"lsems-StoreDataResponse":""

}

}


Here is my code:

Public Sub ConvertXDocToJson()

jsonOut = JsonConvert.SerializeObject(xmlOut)

End Sub


jsonOut is filled with the above json.


How do I remove the @ and # before each attribute?



asked 2 mins ago







Newtonsoft Json: How do I remove the @ put in front of each attribute

Aucun commentaire:

Enregistrer un commentaire