Hi,

I am using the xmljson to convert xml to json. When I do that then I see @
signs added to attributes of an element see example below. How can I remove
the @ signs from the output.

xml file:
 <?xml version="1.0" encoding="utf-8"?>
<current>
  <city id="5095626" name="Bernardsville">
    <coord lon="-74.57" lat="40.68"/>
    <country>US</country>
    <sun rise="2014-11-12T11:42:13" set="2014-11-12T21:42:48"/>
  </city>
  <temperature value="286.59" min="284.95" max="288.15" unit="kelvin"/>
  <humidity value="68" unit="%"/>
  <pressure value="1006.973" unit="hPa"/>
  <wind>
    <speed value="2.66" name="Light breeze"/>
    <direction value="326" code="NW" name="Northwest"/>
  </wind>
  <clouds value="0" name="clear sky"/>
  <visibility/>
  <precipitation mode="no"/>
  <weather number="800" value="Sky is Clear" icon="01n"/>
  <lastupdate value="2014-11-12T23:06:51"/>
</current>

JSON output:
{
    "city": {
        "@id": "5095626",
        "@name": "Bernardsville",
        "coord": {
            "@lon": "-74.57",
            "@lat": "40.68"
        },
        "country": "US",
        "sun": {
            "@rise": "2014-11-12T11:42:13",
            "@set": "2014-11-12T21:42:48"
        }
    },
    "temperature": {
        "@value": "286.59",
        "@min": "284.95",
        "@max": "288.15",
        "@unit": "kelvin"
    },
    "humidity": {
        "@value": "68",
        "@unit": "%"
    },
    "pressure": {
        "@value": "1006.973",
        "@unit": "hPa"
    },
    "wind": {
        "speed": {
            "@value": "2.66",
            "@name": "Light breeze"
        },
        "direction": {
            "@value": "326",
            "@code": "NW",
            "@name": "Northwest"
        }
    },
    "clouds": {
        "@value": "0",
        "@name": "clear sky"
    },
    "visibility": [],
    "precipitation": {
        "@mode": "no"
    },
    "weather": {
        "@number": "800",
        "@value": "Sky is Clear",
        "@icon": "01n"
    },
    "lastupdate": {
        "@value": "2014-11-12T23:06:51"
    }
}




-----
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to