<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">To clarify:<div><br></div><div>I'm not writing server side code to convert my XML to JSON.   Holger already offers conversions on the web.  I don't want to support a huge web server infrastructure.</div><div><br></div><div>If someone really wants MFStrings as JSON strings, please by all means, take a copy of X3dToJson.xslt and modify it to your hearts delight!  I can provide Java-based infrastructure, here: <a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/java/net/coderextreme/RunSaxon.java">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/java/net/coderextreme/RunSaxon.java</a></div><div><br></div><div>This is well tested, but perhaps poorly documented.</div><div><br></div><div>Here are some examples running it in a pipeline.  The "$@" means a list of X3D XML files.  I am running the conversions on multiple processors with the -P ${PROCESSORS}. So something like xargs -P 8, for example , would run on 8 cores. If you want to distribute, I recommend GNU parallel, but I haven't used it.</div><div><div><br></div><div>$ javac -cp "${CLASSPATH}" net/coderextreme/RunSaxon.java</div><div><div>$ ls -d "$@" | grep -v intermediate | grep -v "\.new" | tr '\n' '\0'| xargs -0 -P "$PROCESSORS" java net.coderextreme.RunSaxon --- "${OVERWRITE}" --"${STYLESHEETDIR}/X3dToJson.xslt" -json</div></div><div><br></div><div>$ ls -d "$@" | xargs -P $PROCESSORS java net.coderextreme.RunSaxon ---overwrite ---silent --../lib/stylesheets/X3dToNodeJS.xslt -js ---../node/net/x3djsonld/data/</div><div>$ ls -d "$@"  | xargs -P $PROCESSORS java net.coderextreme.RunSaxon ---overwrite ---silent --../lib/stylesheets/X3dToJava.xslt -java ---../java/net/x3djsonld/data/</div><div>$ ls -d "$@" | xargs -P $PROCESSORS java net.coderextreme.RunSaxon ---overwrite ---silent --../lib/stylesheets/X3dToPython.xslt -py ---../python/net/x3djsonld/data/</div></div><div><br></div><div>I will probably add the X3dToES5.xslt in the near future as I'm working with GraalVM.</div><div><br></div><div>Enjoy!</div><div><br></div><div>John</div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 2, 2023 at 2:37 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">So no one wants have a frank conversation about this?</div><div dir="auto"><br></div><div dir="auto">We need to figure out a solution to MFString in JSON.  We can’t do onesies twosies.</div><div dir="auto"><br></div><div dir="auto">My web page now uses Holger’s Browser.toJSONString().  No other solution works half decently on the web for converting XML to JSON in a browser.  X_ITE creates JSON arrays for MFStrings.</div><div dir="auto"><br></div><div dir="auto">I have brought up this issue many, many times.  Our current Saxon/XSLT solution does not work in a web client.  The Saxon JavaScript version just isn’t there.  I am not going to write server side code.</div><div dir="auto"><br></div><div dir="auto">I am converting XML to JSON over from stylesheets to x3d-tidy, even though Saxon itself works perfectly well in X3D-Edit and in my RunSaxon.java.  Ideally, we could match a web solution with a server-side solution.</div><div dir="auto"><br></div><div dir="auto">At this point, I am following Holger’s lead because there’s no Saxon solution for web clients.</div><div dir="auto"><br></div><div dir="auto">Are we killing X3D JSON? Then let’s be upfront about it and not talk in smoke-filled rooms.</div><div dir="auto"><br></div><div dir="auto">John</div><div dir="auto"><br></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 2, 2023 at 2:58 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><div>The @channels field value in the translated JSON appears as a JSON string, not as  a JSON array.  Here we have the MFString problem again.</div><div><br></div><div>It appears that we have different ideas of what "MF" means.  To me, MF means a JSON array in JSON.  Holger's x3d-tidy tool and X_ITE renders MFStrings as arrays.  I created a special case NavigatorInfo@type.  Can we convert all MFStrings to JSON strings on output, please?  I think that would make everyone happy?</div><div><br></div><div>If our tools don't agree, that will confuse people.</div><div><br></div><div>There's could be issues around MFStrings in Text/fontStyle still. and other places, like urls...do you want those rendered as strings or arrays.</div><div><br></div><div>I'm going to proceed with modifying my schema generator, I'll keep a backup of current stuff.</div></div><div dir="ltr"><div><br></div><div>John</div></div>
</blockquote></div></div>
</blockquote></div>