xml-to-json() function under SaxonJS

Wendell Piez <[email protected]> Tue, 21 Sep 2021 10:12:51 -0400
Newsgroups gmane.text.xml.saxon.help
Message-ID <CAAO_-xwGtf2P8r1C-+RFV=fQ=ZwPXEE-DNdmqSSDBYoCpXVBdw@mail.gmail.com>
--===============2778723714269278341==
Content-Type: multipart/alternative; boundary="000000000000c3578f05cc81fe9a"

--000000000000c3578f05cc81fe9a
Content-Type: text/plain; charset="UTF-8"

Hello Saxonians,

Today I am a bit surprised to find I get no luck, using SaxonJS in the
browser, when trying to serialize JSON as anything but a data brick, when
produced by the function xml-to-json(). It is supposed to accept $options
and 'indent' is the option available, but unless I am missing something,
map{ 'indent':true() } is not operative.

The documentation says that the function json-to-xml() does not support
$options but xml-to-json() is not mentioned. Can I confirm that it is (not)
user error that is preventing me from getting the JSON indented, instead of
prettified?

If this is not supported what is the recommended workaround: perhaps a JSON
serializer is not so hard to write? (I have not thought about it much.)

Thanks for any insight or advice,
Wendell

-- 
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez... ...gitlab.coko.foundation/wendell...

--000000000000c3578f05cc81fe9a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello Saxonians,<div><br></div><div>Today I am a bit surpr=
ised to find I get no luck, using SaxonJS in the browser, when trying to se=
rialize JSON as anything but a data brick, when produced by the function xm=
l-to-json(). It is supposed to accept $options and &#39;indent&#39; is the =
option available, but unless I am missing something, map{ &#39;indent&#39;:=
true() } is not operative.</div><div><br></div><div>The documentation says =
that the function json-to-xml() does not support $options but xml-to-json()=
 is not mentioned. Can I confirm that it is (not) user error that is preven=
ting me from getting the JSON indented, instead of prettified?</div><div><b=
r></div><div>If this is not supported what is the recommended workaround: p=
erhaps a JSON serializer is not so hard to write? (I have not thought about=
 it much.)</div><div><br></div><div>Thanks for any insight or advice,</div>=
<div>Wendell<br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr" class=
=3D"gmail_signature" data-smartmail=3D"gmail_signature">...Wendell Piez... =
...wendell -at- nist -dot- gov...<br>...wendellpiez.com... ...pellucidliter=
ature.org... ...pausepress.org...<br>...<a href=3D"http://github.com/wendel=
lpiez." target=3D"_blank">github.com/wendellpiez.</a>.. ...gitlab.coko.foun=
dation/wendell... </div></div></div>

--000000000000c3578f05cc81fe9a--


--===============2778723714269278341==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============2778723714269278341==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
--===============2778723714269278341==--