title: XML to JSON Conversion Issues
body: <p>Is there a way of converting XML to JSON with reference to a schema.</p>
  
  <p>Lets say a part of the xsd is as below:</p>
  
  <pre><code>  &lt;xs:complexType name="RegionStateResultType"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="RegionOrState"     type="xs:string"  minOccurs="0" maxOccurs="1"/&gt;
        &lt;xs:element name="RegionOrStateCode" type="xs:string"  minOccurs="0" maxOccurs="1"/&gt;
        &lt;xs:element name="PinCode" type="xs:integer"  minOccurs="0" maxOccurs="1"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>and the xml is:</p>
  
  <pre><code>&lt;RegionOrStateInfo&gt;
      &lt;RegionOrState&gt;Tochigi&lt;/RegionOrState&gt;
      &lt;RegionOrStateCode&gt;09&lt;/RegionOrStateCode&gt;
      &lt;PinCode&gt;12345&lt;/PinCode&gt;
  &lt;/RegionOrStateInfo&gt;
  </code></pre>
  
  <p>On Using XMLtoJSON conversion Policy , if we set RecognizeNumber as 'true' then resulting json is:</p>
  
  <pre><code>{
      "RegionOrState": "Tochigi",
      "RegionOrStateCode": "09" ,
      "PinCode":12345
  },
  {
      "RegionOrState": "Tokushima",
      "RegionOrStateCode": 36 ,
      "PinCode":12345
  }
  </code></pre>
  
  <p>If RecognizeNumber is set as 'false' then the resulting json is:</p>
  
  <pre><code>{
      "RegionOrState": "Tochigi",
      "RegionOrStateCode": "09" ,
      "PinCode": "12345"
  },
  {
      "RegionOrState": "Tokushima",
      "RegionOrStateCode": "36" ,
      "PinCode": "12345"
  }
  </code></pre>
  
  <p>The required json is:</p>
  
  <pre><code>{
      "RegionOrState": "Tochigi",
      "RegionOrStateCode": "09" ,
      "PinCode": 12345
  },
  {
      "RegionOrState": "Tokushima",
      "RegionOrStateCode": "36" ,
      "PinCode": 12345
  }
  </code></pre>
  
  <p>Any way of achieving this?</p>
  
  <p>Has anyone used JSONSchema and is there a way for the converter to refer to a schema and then do the translation?</p>
  
  <p>I also faced some issues with single element arrays in XML to JSON conversion. Thinking is JSONSchema can be of some help</p>