Hi David

Previously when I used Corona I had my custom json conversion where I am 
handling the data types based on the element names. So I thought this may be 
available in ML 6 XML to JSON conversion also.

If this is not available. I think it is worth to include :)

Thanks and Regards,

Gnanaprakash Bodireddy
Sr Associate - Projects | IME


-----Original Message-----
From: Bodireddy, Gnanaprakash (Cognizant)
Sent: Wednesday, December 19, 2012 7:30 PM
To: general@developer.marklogic.com
Subject: RE: MarkLogic 6 XML to JSON DataTypes

Hi David

Currently I am not using Schema as there are few limitation to it while 
validations. Currently I am using Schematron for validation of content.

Is there any where we I can specify list of elements which should be treated as 
numbers/Boolean/string similar to enforcing elements as arrays we have?

Thanks and Regards,

Gnanaprakash Bodireddy

Date: Wed, 19 Dec 2012 12:50:44 +0000
From: David Lee <david....@marklogic.com>
Subject: Re: [MarkLogic Dev General] MarkLogic 6 XML to JSON DataTypes
To: MarkLogic Developer Discussion <general@developer.marklogic.com>
Message-ID:
        <6ad72d76c2d6f04d8be471b70d4b991e018...@exchg10-be02.marklogic.com>
Content-Type: text/plain; charset="iso-8859-1"

If there is a schema present which identifies <id> as a numeric type then it 
come out as unquoted.
Similar for booleans.

Otherwise the code has no idea that id is not a string ... and for consistancy 
it treats all untyped atomic valus as strings so you dont get Mis matched data 
like

<user>
                <id>1</id>
                <name>Gnana</name>
</user>

<user>
                <id>a1</id>
                <name>Gnana</name>
</user>




? What type to assign "id" elements in JSON


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of 
gnanaprakash.bodire...@cognizant.com
Sent: Wednesday, December 19, 2012 6:41 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] MarkLogic 6 XML to JSON DataTypes

Hi

I am exploring MarkLogic "XML to JSON" Rest API and am stuck with how to handle 
data types.

For example:
<user>
                <id>1</id>
                <name>Gnana</name>
</user>

Actual JSON Response:
{"user":{"id":"1", "name":"Gnana"}}

Expected JSON Response:
{"user": {"id":1, "name":"Gnana"}}

How can I make sure integer/float/decimal/Boolean data types are not inside 
quotes. Is there any specific config options I could use?

Thanks and Regards,

Gnanaprakash Bodireddy
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful.
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to