Hi, Have you changed any defaults of the xmljson data format? By default it comes with type hints enabled with type hints compatibility = true.
I'm looking at the jsonlib docs and it seems contradictory with the value of type hints compatibility. Could you try calling your attribute json_type, or switching to the TypeHintsEnum.WITH_PREFIX value for the typeHints option? Cheers, *Raúl Kripalani* PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and Messaging Engineer http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk On Thu, Jan 7, 2016 at 4:38 PM, Jack Ding <[email protected]> wrote: > Hello, > I am trying to do the XML to JSON conversion using camel-xmljson with some > specified date types such as number, boolean, etc. > Example 1: input XML:<a> <b>string</b> > > <c>12345</c></a> > > > Expected JSON: > {"a":{"b":"string", "c": 12345}} > You can see 12345 should be a number instead of a string. > > Result JSON:{"a":{"b":"string", "c": "12345"}} > > Notice the double quotes around the 12345. > Example 2: In this example we specify the type="number" . input XML:<a> > <b>string</b> > > <ctype="number">12345</c></a> > > > Expected JSON: > {"a":{"b":"string", "c": 12345}} > You can see 12345 should be a number instead of a string. > > Result JSON:{"a":{"b":"string", "c": {"@type":"number","#text":"12345"}}} > > We are using the spring XML to configure the camel routes and data format. > Could anybody give some advise if there is a easier way to configure above > in Spring XML wihtout involving customized java code? > Thanks >
