[x3d-public] per X3D working group phone call Friday, what to do with " at beginning and ending of attribute value?

John Carlson yottzumm at gmail.com
Fri Apr 9 11:08:10 PDT 2021


And in the JSON spec, can we somehow specify how SFString’s are parsed, so
when we convert JSON to XML, everyone is happy?

Thanks a bunch!

John

On Fri, Apr 9, 2021 at 10:30 AM Don Brutzman <brutzman at nps.edu> wrote:

> John, thanks for your note.
>
> For multiple reasons, we were not able to make progress on this issue
> yesterday during specification editors call and there will likely not be
> enough time today either.  Sorry about that.
>
> Nevertheless, from past meetings, the path forward to improving the
> specification is clear.
>
> a. Review X3D ClassicVRML Encoding prose and formal grammar rules for
> SFString.  These are are stable (since VRML97) and reasonably well
> defined.  Any ambiguity (such as insufficient examples) will be pursued.
>
> b. Review and improve X3D XML Encoding prose and improve.  Essentially
> this is a two-step process: first process SFString attributes following XML
> parsing requirements, then parse results using ClassicVRML grammar.  Both
> steps are rigorously defined and unambiguous.
>
> c. Recenter examples in front of everyone to ensure no ambiguity remains.
>
> Hopefully this answers your question right there.  It also matches what
> our entire XML-based tool suite, and X3DJSAIL and X3DPSAIL, do already.
>
> You already know that I can't keep up with your pace, but our progress
> remains steady and relentless in any case.  8)
>
> Have fun with X3D attributes!  8)
>
>
> On 4/7/2021 1:58 PM, John Carlson wrote:
> >
> > Don,  this stripQuotes for setting attributes may need to be addressed
> per result’s of Vince’s discussion Friday.   StripQuotes is in
> X3DJSONLD.java (you’ve probably renamed it by now).
> >
> > Thanks for taking my code under the X3DJSAIL wing, I don’t know if I’ll
> be able to contribute through svn until I get a new account.   If you feel
> a new account is urgent, I will up the priority.
> >
> > Sigh!
> >
> > On Sat, Apr 3, 2021 at 4:49 PM John Carlson <yottzumm at gmail.com <mailto:
> yottzumm at gmail.com>> wrote:
> >
> >     Vince mentioned '"radius"' in phone call Friday as a valid XML
> >     SFString.   So perhaps I shouldn't strip matching bounding quotes off
> >     when converting to a DOM structure?
> >
> >     This affects X3DJSONLD.java. I don't think I've coded this into any
> >     JavaScript at this point. X3DJSONLD.cpp also has issues. (Are there
> >     users of X3DJSONLD in Java and C++?)
> >
> >     It was kind of a serendipitous find (and amazing that i was on the
> phone
> >     call at all)...There are 4 other uses in X3DJSONLD.java that need to
> be
> >     investigated.
> >
> >     Thank Don, for pushing me to have a working JSON loader in
> X3DJSAIL.  If
> >     Don doesn't go ahead an program loading X3D JSON into X3DJSAIL
> >     (X3DJSONLD.java's currently in the net.coderextreme package).
> >
> >     I am sorry I have had other pursuits, and have not been spending
> time on
> >     JSON.  I agree that this is my primary volunteer responsibility.   I
> >     will look into issues, if any, on GitHub. Has someone posted an
> issue on
> >     github under X3DJSONLD? I don't see any. I just added one.
> >
> >     I wouldn't call either X3DJSONLD.java or X3DJSONLD.cpp sufficiently
> >     tested, at least beyond Don's X3DJSAIL HelloWorld examples.   Real
> world
> >     struggles and stories are welcome.
> >
> >       From X3DJSONLD.java:
> >
> >          public String stripQuotes(String value) {
> >                       if (value.charAt(0) == '"' &&
> >     value.charAt(value.length()-1) == '"') {
> >                               return value.substring(1,
> value.length()-1);
> >                       } else {
> >                               return value;
> >                       }
> >               }
> >               public void elementSetAttribute(Element element, String
> key,
> >     String value) {
> >                       if (key.equals("SON schema")) {
> >                               // JSON Schema
> >                       } else if (key.equals("ncoding")) {
> >                               // encoding, UTF-8, UTF-16 or UTF-32
> >                       } else {
> >                               // System.err.println(key+"= SA "+value);
> >                               element.setAttribute(key,
> stripQuotes(value));
> >                       }
> >               }
> >
> >     The question becomes, why do I have stripQuotes in X3DJSONLD.java and
> >     X3DJSONLD.cpp?????  Probably the X3DJSAIL version is more tested than
> >     X3DJSONLD's version of X3DJSONLD.java.
> >
> >
> >     Here are primary test cases of X3DJSONLD:
> >
> >
> >     /c/x3d-code/www.web3d.org/x3d/stylesheets/java$ <
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.web3d.org%2Fx3d%2Fstylesheets%2Fjava%24&data=04%7C01%7Cbrutzman%40nps.edu%7Cb12c5cd7ceb14308040208d8fa0813f1%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637534260228416291%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ZKY5oPekSSmDHKOAyohhc%2BY%2FzJN4EDi2QiDrjISmrnE%3D&reserved=0>
> grep -l X3DJSONLD
> >     */examples/*
> >     nashorn/examples/Java.java
> >     nashorn/examples/Json.js
> >     nashorn/examples/Nashorn.js
> >     nashorn/examples/Node.js
> >     nashorn/examples/Quotes.js
> >     node/examples/Java.java
> >     node/examples/X3Dautoclass.js
> >
> >
> >     (I know the names are bad, apologies).
> >
> >
> >     Here are examples one might use to test, if you can identify
> SFStrings:
> >
> >
> >     /c/x3d-code/www.web3d.org/x3d/stylesheets/java/examples$ <
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.web3d.org%2Fx3d%2Fstylesheets%2Fjava%2Fexamples%24&data=04%7C01%7Cbrutzman%40nps.edu%7Cb12c5cd7ceb14308040208d8fa0813f1%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637534260228426279%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Yvhdi5mDFpBnzdgNSlSdCULUKruxoyzM5hrmHVktQYc%3D&reserved=0>
> grep -l
> >     \'\"[^\"]*\"\' *
> >     CleatClamp.py
> >     CleatClamp.x3d
> >     HelloWorldProgram.java
> >     HelloWorldProgramOutputCanonical.x3d
> >     HelloWorldProgramOutputCanonical.xml
> >     HelloWorldProgramOutput_CommandLine.html
> >     HelloWorldProgramOutput_CommandLineUnzipped.x3d
> >     HelloWorldProgramOutput_CommandLine.x3d
> >     HelloWorldProgramOutput_CommandLine.xml
> >     HelloWorldProgramOutput.html
> >     HelloWorldProgramOutputLog.txt
> >     HelloWorldProgramOutput_ReloadedDOM.x3d
> >     HelloWorldProgramOutputTidy_CommandLine.x3d
> >     HelloWorldProgramOutputTidy.x3d
> >     HelloWorldProgramOutput.wrl
> >     HelloWorldProgramOutput.x3d
> >     HelloWorldProgramOutput.x3dv
> >     HelloWorldProgramOutput.xml
> >
> >
> >     /c/x3d-code/www.web3d.org/x3d/stylesheets/java/nashorn/examples$ <
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.web3d.org%2Fx3d%2Fstylesheets%2Fjava%2Fnashorn%2Fexamples%24&data=04%7C01%7Cbrutzman%40nps.edu%7Cb12c5cd7ceb14308040208d8fa0813f1%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637534260228426279%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=xR94ZXu4pwb2b3GUNybKMrEisdyMuzxIsOjTxMkB7X4%3D&reserved=0>
> grep -l
> >     \'\"[^\"]*\"\' *
> >     HelloWorldProgramOutput.Java.x3d
> >     HelloWorldProgramOutput.Nashorn.js.newPrettyPrint.intermediate.x3d
> >     HelloWorldProgramOutput.Nashorn.js.new.x3d
> >     HelloWorldProgramOutput.x3d
> >     Java.x3d
> >     JsonPrettyPrint.intermediate.x3d
> >     Json.x3d
> >     Nashorn0.x3d
> >     NashornPrettyPrint.intermediate.x3d
> >     Nashorn.x3d
> >     Node0.x3d
> >     Node.x3d
> >     Quotes.x3d
> >
> >     X3d.x3d
> >
> >
> >     /c/x3d-code/www.web3d.org/x3d/stylesheets/java/node/examples$ <
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.web3d.org%2Fx3d%2Fstylesheets%2Fjava%2Fnode%2Fexamples%24&data=04%7C01%7Cbrutzman%40nps.edu%7Cb12c5cd7ceb14308040208d8fa0813f1%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637534260228436271%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Ex5mSHCzZ%2Bx6uRL0H%2BKlGIOfybkS%2FHIyLvGN35tEM7k%3D&reserved=0>
> grep -l
> >     \'\"[^\"]*\"\' *
> >     HelloWorldProgramOutput.Java.x3d
> >     HelloWorldProgramOutput.x3d
> >     Java.x3d
> >     Json.x3d
> >     Node0.x3d
> >     Node.x3d
> >     Quotes.x3d
> >     X3d.x3d
> >
> >     It was likely that I was struggling over quoting in the nashorn
> >     examples, but my memory is pretty much non-existent about this until
> I
> >     get back into it.
> >
> >
> >     Do people want a typesafe library for loading JavaScript, or
> something
> >     more like a DOM-based loader?  I'll make a new message for this.
> >
> >     John
> >
> >
> > _______________________________________________
> > x3d-public mailing list
> > x3d-public at web3d.org
> > http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> >
>
> all the best, Don
> --
> Don Brutzman  Naval Postgraduate School, Code USW/Br
> brutzman at nps.edu
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics
> http://faculty.nps.edu/brutzman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210409/7b603361/attachment-0001.html>


More information about the x3d-public mailing list