JSON.NET - Can I hint types in XML to be parsed?

thedudleys

New Member
When I parse XML using JsonConvert.SerializeXNode or JsonConvert.SerializeXmlNode the following code\[code\]XElement person = XElement.Parse(@" <person> <name>Palle</name> <member>true</member> </person>");string json = JsonConvert.SerializeXNode(person);\[/code\]give me this json result:\[code\]{"person":{"name":"Palle","member":"true"}}\[/code\]Here member is typed as a string, I would like this to be typed as a bool. Can I add type hints in the XML (like \[code\]<member type="xsd:boolean">true</member>\[/code\]) and have the parser pick up on this?I would like to get this result instead:\[code\]{"person":{"name":"Palle","member":true}}\[/code\]
 
Back
Top