Mechanism to serialize maps in output?
Tuesday, 27 March 2012 · 4 messages
CD
Charles Duffy27 Mar 2012 04:05 #
Howdy --
Right now, trying to inspect a map (ie. returning one from a query) results in FOTY0012. This is unfortunate from the perspective of allowing users to examine the objects their logic creates. Has thought been given to defining a serialization-friendly way of representing maps, perhaps as XML entities under their own namespace?
MS
Michael Seiferle27 Mar 2012 09:47 #
Hi Charles,
I wrote a small script for myself, together with Leo from our team, to serialize maps directly from XQuery.
https://gist.github.com/3f2731c1211f7188664c
It might not cover each corner-case but is still quite handy.
Hope this helps a little, in the meantime we will investigate whether we will provide an integrated function.
Hope this helps :-)
Michael
Quoted text · Charles Duffy · 18 lines
Am 27.03.2012 um 02:05 schrieb Charles Duffy: > Howdy -- > > Right now, trying to inspect a map (ie. returning one from a query) results in FOTY0012. This is unfortunate from the perspective of allowing users to examine the objects their logic creates. Has thought been given to defining a serialization-friendly way of representing maps, perhaps as XML entities under their own namespace? > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk Am 27.03.2012 um 02:05 schrieb Charles Duffy: > Howdy -- > > Right now, trying to inspect a map (ie. returning one from a query) results in FOTY0012. This is unfortunate from the perspective of allowing users to examine the objects their logic creates. Has thought been given to defining a serialization-friendly way of representing maps, perhaps as XML entities under their own namespace? > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
HR
Hello,
perhaps it is also worthwhile to check how MarkLogic serializes maps.
Kind regards,
Hans-Juergen Rennau
PS: Here comes an example (representing a map containing map): <map:map xmlns:map="http://marklogic.com/xdmp/map">
<map:entry key="GlobalDates">
<map:value xsi:type="map:map">
<map:map>
<map:entry key="Booking">
<map:value xsi:type="xs:date">2012-03-22</map:value>
</map:entry>
<map:entry key="Duration">
<map:value xsi:type="xs:integer">7</map:value>
</map:entry>
<map:entry key="CheckIn">
<map:value xsi:type="xs:date">2012-06-04</map:value>
</map:entry>
<map:entry key="CheckOut">
<map:value xsi:type="xs:date">2012-06-11</map:value>
</map:entry>
</map:map>
</map:value>
</map:entry>
</map:map>________________________________
Von: Charles Duffy <charles at dyfis.net>
An: basex-talk at mailman.uni-konstanz.de
Gesendet: 2:05 Dienstag, 27.März 2012
Betreff: [basex-talk] Mechanism to serialize maps in output?
Howdy --
Right now, trying to inspect a map (ie. returning one from a query) results in FOTY0012. This is unfortunate from the perspective of allowing users to examine the objects their logic creates. Has thought been given to defining a serialization-friendly way of representing maps, perhaps as XML entities under their own namespace?
CG
Christian Grün27 Mar 2012 22:16 #
Hi Charles, and thanks Hans-Jürgen,
I've added a GitHub issue to avoid that this is getting lost:
https://github.com/BaseXdb/basex/issues/448
Christian
Quoted text · Hans-Juergen Rennau · 50 lines
On Tue, Mar 27, 2012 at 2:48 PM, Hans-Juergen Rennau <hrennau at yahoo.de> wrote: > Hello, > > perhaps it is also worthwhile to check how MarkLogic serializes maps. > > Kind regards, > Hans-Juergen Rennau > > PS: Here comes an example (representing a map containing map): > <map:map xmlns:map="http://marklogic.com/xdmp/map"> > <map:entry key="GlobalDates"> > <map:value xsi:type="map:map"> > <map:map> > <map:entry key="Booking"> > <map:value xsi:type="xs:date">2012-03-22</map:value> > </map:entry> > <map:entry key="Duration"> > <map:value xsi:type="xs:integer">7</map:value> > </map:entry> > <map:entry key="CheckIn"> > <map:value xsi:type="xs:date">2012-06-04</map:value> > </map:entry> > <map:entry key="CheckOut"> > <map:value xsi:type="xs:date">2012-06-11</map:value> > </map:entry> > </map:map> > </map:value> > </map:entry> > </map:map> > > ________________________________ > Von: Charles Duffy <charles at dyfis.net> > An: basex-talk at mailman.uni-konstanz.de > Gesendet: 2:05 Dienstag, 27.März 2012 > Betreff: [basex-talk] Mechanism to serialize maps in output? > > Howdy -- > > Right now, trying to inspect a map (ie. returning one from a query) results > in FOTY0012. This is unfortunate from the perspective of allowing users to > examine the objects their logic creates. Has thought been given to defining > a serialization-friendly way of representing maps, perhaps as XML entities > under their own namespace? > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 7.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery