Hi - I am converting XML doc to json and it was working before till today.

Now suddenly <abstract> and <name> elements values are converting into
"null" values.

I am using custom config strategy.

Have someone faced this issue before?

XML:
<data total="1" start="1" pageLength="20">
    <result score="0">
        <created>2017-08-31T16:00:08.131792-04:00</created>
        <jw-approval-date/>
        <jw-article-state>active</jw-article-state>
        <pubdate>2017-08-31</pubdate>
        <doi>10.1056/nejm-jw.NA44895</doi>
        <id>NA44895</id>
        <title>When Genetic Testing Is Unproven: The Case of Depression
Treatments</title>
        <uri>/nlm-articles/jwx/2017/08/31/jx-NA44895.xml</uri>
        <abstracts>
            <abstract abstract-type="blurb">
                Genetic testing of your depressed patient will not help you
find the right medication.
            </abstract>
        </abstracts>
        <specialities>
            <speciality>Psychiatry</speciality>
        </specialities>
        <free>Yes</free>
        <authors>
            <author>
                <id>AU111</id>
                <name>Peter Roy-Byrne, MD</name>
            </author>
            <author>
                <name>Steven Dubovsky, MD, Joel Yager, MD</name>
            </author>
        </authors>
...

JSON


Code:
let $xml := <<XML node>>
 let $custom :=
    let $config := json:config("custom")
    let $_ := map:put( $config, "whitespace", "ignore" )
    let $_ := map:put( $config, "array-element-names", ("result",
"abstract", "speciality", "article", "author") )
    return $config
  return
    json:transform-to-json( $xml, $custom )


Please note when I am using "full" strategy, <name> is showing value.

Thank you for your help!

Regards,
Indy
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to