'indent' option for json:serialize()
Saturday, 20 June 2015 · 4 messages · last reply 22 Jun 2015
AG
Amanda Galtman20 Jun 2015 02:36 #
Hi,
In the
json:serialize() function, the 'indent' option does not seem to be accepted. Is it an outdated option?
For example, the following returns "Unknown option 'indent'." in BaseX 8.2.1.json:serialize(
json:parse('[{"a":"b"}]'),
map {'indent':'no'}
)The 'indent' option doesn't work for
json:parse() either, though the doc does not suggest it should.
Thanks,
AmandaCG
Christian Grün22 Jun 2015 09:31 #
Hi Amanda,
During the implementation of
fn:xml-to-json, the 'indent' option got swept under the table. It has just been reintroduced, and it is here to say.
Thanks,
Christian
[1] http://files.basex.org/releases/latest/Quoted text · Amanda Galtman · 34 lines
On Sat, Jun 20, 2015 at 2:36 AM, Amanda Galtman <Amanda.Galtman at mathworks.com> wrote: > Hi, > > > > In the json:serialize() function, the ‘indent’ option does not seem to be > accepted. Is it an outdated option? > > > > For example, the following returns “Unknown option ‘indent’.” in BaseX > 8.2.1. > > > > json:serialize( > > json:parse('[{"a":"b"}]'), > > map {'indent':'no'} > > ) > > > > The ‘indent’ option doesn’t work for json:parse() either, though the doc > does not suggest it should. > > > > Thanks, > > Amanda
AG
Amanda Galtman22 Jun 2015 13:44 #
Great, thanks!
Amanda
Quoted text · Christian Grün · 52 lines
> -----Original Message----- > From: Christian Grün [mailto:christian.gruen at gmail.com] > Sent: Monday, June 22, 2015 3:31 AM > To: Amanda Galtman > Cc: basex-talk at mailman.uni-konstanz.de > Subject: Re: [basex-talk] 'indent' option for json:serialize() > > Hi Amanda, > > During the implementation of fn:xml-to-json, the 'indent' option got swept > under the table. It has just been reintroduced, and it is here to say. > > Thanks, > Christian > > [1] http://files.basex.org/releases/latest/ > > > On Sat, Jun 20, 2015 at 2:36 AM, Amanda Galtman > <Amanda.Galtman at mathworks.com> wrote: > > Hi, > > > > > > > > In the json:serialize() function, the ‘indent’ option does not seem to > > be accepted. Is it an outdated option? > > > > > > > > For example, the following returns “Unknown option ‘indent’.” in BaseX > > 8.2.1. > > > > > > > > json:serialize( > > > > json:parse('[{"a":"b"}]'), > > > > map {'indent':'no'} > > > > ) > > > > > > > > The ‘indent’ option doesn’t work for json:parse() either, though the > > doc does not suggest it should. > > > > > > > > Thanks, > > > > Amanda
CG
Christian Grün22 Jun 2015 18:25 #
…and thank *you* for the regular edits in our Wiki!
Quoted text · Amanda Galtman · 58 lines
On Mon, Jun 22, 2015 at 1:44 PM, Amanda Galtman <Amanda.Galtman at mathworks.com> wrote: > Great, thanks! > > Amanda > >> -----Original Message----- >> From: Christian Grün [mailto:christian.gruen at gmail.com] >> Sent: Monday, June 22, 2015 3:31 AM >> To: Amanda Galtman >> Cc: basex-talk at mailman.uni-konstanz.de >> Subject: Re: [basex-talk] 'indent' option for json:serialize() >> >> Hi Amanda, >> >> During the implementation of fn:xml-to-json, the 'indent' option got swept >> under the table. It has just been reintroduced, and it is here to say. >> >> Thanks, >> Christian >> >> [1] http://files.basex.org/releases/latest/ >> >> >> On Sat, Jun 20, 2015 at 2:36 AM, Amanda Galtman >> <Amanda.Galtman at mathworks.com> wrote: >> > Hi, >> > >> > >> > >> > In the json:serialize() function, the ‘indent’ option does not seem to >> > be accepted. Is it an outdated option? >> > >> > >> > >> > For example, the following returns “Unknown option ‘indent’.” in BaseX >> > 8.2.1. >> > >> > >> > >> > json:serialize( >> > >> > json:parse('[{"a":"b"}]'), >> > >> > map {'indent':'no'} >> > >> > ) >> > >> > >> > >> > The ‘indent’ option doesn’t work for json:parse() either, though the >> > doc does not suggest it should. >> > >> > >> > >> > Thanks, >> > >> > Amanda
Written for BaseX 8.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery