Hi Erik

Is there any way where we can specify in configurations not to treat an element 
for json conversion.

If there is a way then I think we can easily handle the issue I am facing.

Gnana

Gnanaprakash Bodireddy | Sr. Associate - Projects | IME | Cognizant Technology 
Solutions.
Address: Raheja MindSpace, 7th Floor, Hyderabad.
O: +91 (40) 44514444 extn: 672103| Mobile: +91 8897575644

From: Bodireddy, Gnanaprakash (Cognizant)
Sent: Tuesday, January 29, 2013 2:05 PM
To: general@developer.marklogic.com; erik.hen...@marklogic.com
Subject: Custom JSON convertion issue in ML 6

Hi Erik

Not sure whether I can call this as an issue or not. but I am facing an issue 
using custom json conversion

Sample Code:
xquery version "1.0-ml";
import module namespace json="http://marklogic.com/xdmp/json"; at 
"/MarkLogic/json/json.xqy";
let $x := <employee><code>01</code><label>gnana <span>prakash</span> 
bodireddy</label></employee>
let $config := json:config("custom") ,
    $cx := map:put( $config, "whitespace", "ignore" )
let $config-full := json:config("full") ,
    $cx := map:put( $config, "whitespace", "ignore" )
return (json:transform-to-json($x,$config),
        json:transform-to-json($x,$config-full))

Response:
{"employee":{"code":"01", "label":{"_value":" bodireddy", "span":"prakash"}}}
{"employee":{"_children":[{"code":{"_children":["01"]}},{"label":{"_children":["gnana
 ",{"span":{"_children":["prakash"]}}," bodireddy"]}}]}}

In the above response, when used "custom" the leading text value "gnana" is 
missing. How can we get the text?

Note: I am trying to do the json converstion on node with highlighting (with 
span as an element)

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