[MarkLogic Dev General] JSON with MarkLogic

Shannon Shiflett at virginia.edu
Thu Jun 14 06:42:21 PDT 2012


In fact, two cases. First, an object with multiple name/value pairs. Second, an array of objects. 

Perhaps:

<select>
 <object>
  <label>value</label>
  <category>books</category>
  [...]
 </object>
 <object>
  <label>value</label>
  <category>magazines</category>
  [...]
 </object>
 [...]
</select>

=>

{
"select": [
 { "label":"value" , "category":"books", [...]}, 
 { "label":"value" , "category":"magazines" }, 
 [...]
 ],
[...]
}

Apologies for any syntactical mistakes--just proposing some patterns....
Thanks.

On Jun 14, 2012, at 9:17 AM, Shannon wrote:

> Justin stated that MarkLogic is looking to improve built-in JSON support and requested details on what we are trying to accomplish. It is helpful for returning an array of strings, but I'm seeking to convert an XML structure into an array of objects, e.g.,
> 
> <object>
>  <label>value</l>
>  <category>books</l>
>  [...]
> </object>
> 
> =>
> 
> [ { label: "value", category: "books" }, ... ]
> 
> I know about mljson and map:map, but I wanted to share a frequent case that could make xdmp:to-json more useful--maybe flags for alternate serializations?
> 
> Thanks,
> 
> 	Shannon (Shiflett at virginia.edu)
> 		http://www.facebook.com/uvapress
> 		http://www.twitter.com/uvapress
> 
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> http://community.marklogic.com/mailman/listinfo/general



More information about the General mailing list