[X3D-Ecosystem] JSON to DOM to Bindings
John Carlson
yottzumm at gmail.com
Wed Jun 25 01:39:30 PDT 2025
I guess a better way might be to add the serializer imports to json2all.js
and then use the import variables in the list of serializer data in
convertJSON() call instead of strings, avoiding eval(). Hmm! This is why
I send so many emails (obviously).
I’ll try to get these in soon, but tasks are piling up!
Thanks for feedback!
John
On Wed, Jun 25, 2025 at 3:29 AM John Carlson <yottzumm at gmail.com> wrote:
> Note that with imports, instead of require() in ECMAScript, you will need
> to add your new Serializer (.js) import to
> X3DJSONLD/src/main/node/convertJSON.js in addition to naming it in
> X3DJSONLD/src/main/node/json2all.js
>
> Apologies. Let me know if there’s another way. My way uses eval to
> resolve the string to an imported variable. I tried dynamic imports
> without success:(.
>
> John
>
> On Tue, Jun 24, 2025 at 3:18 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> I am documenting the subject line here.
>>
>> To convert X3D JSON to DOM to Bindings in X3DJSONLD:
>>
>> $ cd X3DJSONLD/src/main
>>
>> Place X3D JSON files in ./data/. The name should end in .json, and not
>> include “new.”
>>
>> $ cd ./shell/.
>>
>> Edit classpath file to taste.
>>
>> Convert files:
>>
>> $ bash runjson.sh
>>
>> Look at log for errors.
>>
>> $ cd ../.
>>
>> Look in */net/coderextreme/data/. for your output.
>>
>> Edit ./node/json2all.js to add or configure serializers converting from
>> DOM.
>>
>> Recent Serializers include ./node/PythonSerializerX3DJSAIL.js and
>> ./node/GuraSerializer.js
>>
>> John
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250625/5f9ffbe0/attachment.html>
More information about the X3D-Ecosystem
mailing list