From: Joe W. <jo...@gm...> - 2023-01-26 18:40:11
|
Hi Bernie, Did you by chance see my earlier response with links to code demonstrating how to use the json-ignore-whitespace-text-nodes property? Joe On Thu, Jan 26, 2023 at 1:32 PM Harris, Bernard T. (GSFC-5870) < ber...@na...> wrote: > https://cdaweb.gsfc.nasa.gov/registry/hdp/restxqJson-0.1.xar > > contains an example app that demonstrates my problem. Once the > application is install, > > > > $ curl http://localhost:8100/exist/restxq/test > > { "collection" : { "resource" : { "Spase" : { "xsi:schemaLocation" : http://www.spase-group.org/data/schema > https://www.spase-group.org/data/schema/spase-2_4_0.xsd > <http://www.spase-group.org/data/schema%20https:/www.spase-group.org/data/schema/spase-2_4_0.xsd>, > "#text" : ["\n ", "\n ", "\n" ], "Version" : "2.4.0", "NumericalData" : > { "#text" : ["\n ", "\n ", "\n " ], "ResourceID" : > "spase://NASA/NumericalData/ACE/CRIS/L2/PT1H", "ResourceHeader" : { "#text" > : ["\n ", "\n ", "\n ", "\n " ], > "ResourceName" : "ACE Cosmic Ray Isotope Spectrometer (CRIS) 1-Hour Level 2 > Data", "DOI" : https://doi.org/10.48322/g72t-0814, "ReleaseDate" : > "2022-05-17T12:34:56.789" } } } } } > > > > Demonstrates the problem. If you change the code to > > let $example := 2 > > so that the xml does not come from the db, the json will not contain all > the “#text” stuff. Let me know if you need anything else. Thanks for > looking at this. > > > > Bernie Harris > > > > *From: *"Harris, Bernard T. (GSFC-5870)" <ber...@na...> > *Date: *Thursday, January 26, 2023 at 5:26 AM > *To: *Joe Wicentowski <jo...@gm...> > *Cc: *Exist-open <exi...@li...> > *Subject: *Re: [Exist-open] [EXTERNAL] json-ignore-whitespace-text-nodes > > > > I’m still attempting to reproduce in a minimal amount of code but it is > taking a lot of time. But maybe just seeing the output will be enough for > you to know what is wrong. This is a RESTXQ application and I first > noticed the problem on exist 6.0.1 but have also now reproduced it on 4.4. > Here is a little bit of the output > > > > $ curl -s -H "Accept: application/json" > http://localhost:8100/exist/restxq/Spase/NumericalData?ResourceID=spase://NASA/NumericalData/ACE/MAG/L2/PT16S > |jq |head -15 > > { > > "collection": { > > "resource": { > > "Spase": { > > "xsi:schemaLocation": http://www.spase-group.org/data/schema > https://www.spase-group.org/data/schema/spase-2_3_2.xsd > <http://www.spase-group.org/data/schema%20%20https:/www.spase-group.org/data/schema/spase-2_3_2.xsd> > , > > "#text": [ > > "\n ", > > "\n ", > > "\n" > > ], > > "Version": "2.3.2", > > "NumericalData": { > > "#text": [ > > "\n ", > > "\n ", > > > > The problem is all the extra #text values. They don’t appear in the xml > output. Years ago when I developed something similar without RESTXQ, this > > > > declare option exist:serialize "json-ignore-whitespace-text-nodes=yes"; > > > > eliminated the extra #text stuff. But that does not work in my RESTXQ > app. and it will take me more time to create a minimal RESTXQ example. I > would apricate any help you can give but understand if you need example > code. > > > > Bernie > > > > *From: *Joe Wicentowski <jo...@gm...> > *Date: *Wednesday, January 25, 2023 at 6:07 AM > *To: *"Harris, Bernard T. (GSFC-5870)" <ber...@na...> > *Cc: *Exist-open <exi...@li...> > *Subject: *Re: [Exist-open] [EXTERNAL] json-ignore-whitespace-text-nodes > > > > Could you provide more info? How to reproduce? Expected vs. actual > results? What version of eXist? > > > > On Wed, Jan 25, 2023 at 5:39 AM Harris, Bernard T. (GSFC-5870) via > Exist-open <exi...@li...> wrote: > > I noticed the same thing. But I was working with RESTXQ (and exist-db > 6.0.1) for the first time and thought I might need to do things differently > than the way it had worked in the past. I would like to know if this is a > bug or if there is a different way to accomplish the same thing. > > > > Bernie Harris > > > > *From: *Eduard Drenth <ed...@fr...> > *Date: *Sunday, January 22, 2023 at 11:22 AM > *To: *Exist-open <exi...@li...> > *Subject: *[EXTERNAL] [Exist-open] json-ignore-whitespace-text-nodes > > > > json-ignore-whitespace-text-nodes not supported anymore? > > > > > > > > Eduard Drenth, Software Architekt > > > > ed...@fr... > > > > Doelestrjitte 8 > > 8911 DX Ljouwert > > (058) 213 14 14 > > +31 62 094 34 28 > > https://www.fryske-akademy.nl/ > <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fryske-akademy.nl%2F&data=05%7C01%7Cbernard.t.harris%40nasa.gov%7C7e5a6f8b6e754f7436e608dafec43f34%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638102416673638149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0O1QGHF%2FoYAWVIsHuJpNXaBG5Pwmyt41aNnjYAtEt7I%3D&reserved=0> > > https://frysker.nl/ > <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffrysker.nl%2F&data=05%7C01%7Cbernard.t.harris%40nasa.gov%7C7e5a6f8b6e754f7436e608dafec43f34%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638102416673638149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=y%2F5CFfYDWLmNlEf8MfDuI2zr6SWF%2FQY8R8bnttYLGzo%3D&reserved=0> > > https://frisian.eu/ > <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffrisian.eu%2F&data=05%7C01%7Cbernard.t.harris%40nasa.gov%7C7e5a6f8b6e754f7436e608dafec43f34%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638102416673638149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=suopw7zfA7r3EW4%2FFt1aLlEMe2iQl%2BjX7JREqXeT7uw%3D&reserved=0> > > gpg: pgp.key-server.io/pks/lookup?search=eduarddrenth > <https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpgp.key-server.io%2Fpks%2Flookup%3Fsearch%3Deduarddrenth&data=05%7C01%7Cbernard.t.harris%40nasa.gov%7C7e5a6f8b6e754f7436e608dafec43f34%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638102416673638149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XcyiU9dnfYQGMDlFxq%2FUZKND0Xmo4xkbFq3lv5nqwa8%3D&reserved=0> > > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fexist-open&data=05%7C01%7Cbernard.t.harris%40nasa.gov%7C7e5a6f8b6e754f7436e608dafec43f34%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638102416673638149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bvDGOROh5LtgzYwxDnv8NHx7lgfsZFPUVTfD6BRYL5k%3D&reserved=0> > > -- > > Sent from my iPhone > |