The problem: When converting from XML to JSON, quotation marks should only be used for strings and not be used for numbers, booleans, etc
The following XML:
<root>
<someNumber>22</someNumber>
<someBoolean>true</someBoolean>
<someString>23</someString>
</root>
Should be mapped to this JSON:
{
root: {
someNumber: 22,
someBoolean: true,
someString: "23"
}
}
And not this:
{
root: {
someNumber: "22",
someBoolean: "true",
someString: "23"
}
}
Using type information from the XSD:
<xs:complexType name="someComplexType">
<xs:all>
<xs:element name="someNumber" type="xs:integer"/>
<xs:element name="someBoolean" type="xs:boolean"/>
<xs:element name="someString" type="xs:string"/>
</xs:all>
</xs:complexType>
Currently I'm using JsonConvert.SerializeXNode (from Newtonsoft Json.NET)
I have all the type information in the XSD (Xml Schema), and do not want to add any additional type information using XML attributes, as suggested when using JsonConvert.SerializeXNode.
Is it possible to provide the XSD when converting from JSON to XML?
Could anyone please point me in the right direction?