<div dir="auto">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).</div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">Sigh!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 3, 2021 at 4:49 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-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Vince mentioned '"radius"' in phone call Friday as a valid XML <br>
SFString.   So perhaps I shouldn't strip matching bounding quotes off <br>
when converting to a DOM structure?<br>
<br>
This affects X3DJSONLD.java. I don't think I've coded this into any <br>
JavaScript at this point. X3DJSONLD.cpp also has issues. (Are there <br>
users of X3DJSONLD in Java and C++?)<br>
<br>
It was kind of a serendipitous find (and amazing that i was on the phone <br>
call at all)...There are 4 other uses in X3DJSONLD.java that need to be <br>
investigated.<br>
<br>
Thank Don, for pushing me to have a working JSON loader in X3DJSAIL.  If <br>
Don doesn't go ahead an program loading X3D JSON into X3DJSAIL <br>
(X3DJSONLD.java's currently in the net.coderextreme package).<br>
<br>
I am sorry I have had other pursuits, and have not been spending time on <br>
JSON.  I agree that this is my primary volunteer responsibility.   I <br>
will look into issues, if any, on GitHub. Has someone posted an issue on <br>
github under X3DJSONLD? I don't see any. I just added one.<br>
<br>
I wouldn't call either X3DJSONLD.java or X3DJSONLD.cpp sufficiently <br>
tested, at least beyond Don's X3DJSAIL HelloWorld examples.   Real world <br>
struggles and stories are welcome.<br>
<br>
 From X3DJSONLD.java:<br>
<br>
    public String stripQuotes(String value) {<br>
                 if (value.charAt(0) == '"' && <br>
value.charAt(value.length()-1) == '"') {<br>
                         return value.substring(1, value.length()-1);<br>
                 } else {<br>
                         return value;<br>
                 }<br>
         }<br>
         public void elementSetAttribute(Element element, String key, <br>
String value) {<br>
                 if (key.equals("SON schema")) {<br>
                         // JSON Schema<br>
                 } else if (key.equals("ncoding")) {<br>
                         // encoding, UTF-8, UTF-16 or UTF-32<br>
                 } else {<br>
                         // System.err.println(key+"= SA "+value);<br>
                         element.setAttribute(key, stripQuotes(value));<br>
                 }<br>
         }<br>
<br>
The question becomes, why do I have stripQuotes in X3DJSONLD.java and <br>
X3DJSONLD.cpp?????  Probably the X3DJSAIL version is more tested than <br>
X3DJSONLD's version of X3DJSONLD.java.<br>
<br>
<br>
Here are primary test cases of X3DJSONLD:<br>
<br>
<br>
/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java$" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java$</a> grep -l X3DJSONLD <br>
*/examples/*<br>
nashorn/examples/Java.java<br>
nashorn/examples/Json.js<br>
nashorn/examples/Nashorn.js<br>
nashorn/examples/Node.js<br>
nashorn/examples/Quotes.js<br>
node/examples/Java.java<br>
node/examples/X3Dautoclass.js<br>
<br>
<br>
(I know the names are bad, apologies).<br>
<br>
<br>
Here are examples one might use to test, if you can identify SFStrings:<br>
<br>
<br>
/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples$" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/examples$</a> grep -l <br>
\'\"[^\"]*\"\' *<br>
CleatClamp.py<br>
CleatClamp.x3d<br>
HelloWorldProgram.java<br>
HelloWorldProgramOutputCanonical.x3d<br>
HelloWorldProgramOutputCanonical.xml<br>
HelloWorldProgramOutput_CommandLine.html<br>
HelloWorldProgramOutput_CommandLineUnzipped.x3d<br>
HelloWorldProgramOutput_CommandLine.x3d<br>
HelloWorldProgramOutput_CommandLine.xml<br>
HelloWorldProgramOutput.html<br>
HelloWorldProgramOutputLog.txt<br>
HelloWorldProgramOutput_ReloadedDOM.x3d<br>
HelloWorldProgramOutputTidy_CommandLine.x3d<br>
HelloWorldProgramOutputTidy.x3d<br>
HelloWorldProgramOutput.wrl<br>
HelloWorldProgramOutput.x3d<br>
HelloWorldProgramOutput.x3dv<br>
HelloWorldProgramOutput.xml<br>
<br>
<br>
/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/nashorn/examples$" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/nashorn/examples$</a> grep -l <br>
\'\"[^\"]*\"\' *<br>
HelloWorldProgramOutput.Java.x3d<br>
HelloWorldProgramOutput.Nashorn.js.newPrettyPrint.intermediate.x3d<br>
HelloWorldProgramOutput.Nashorn.js.new.x3d<br>
HelloWorldProgramOutput.x3d<br>
Java.x3d<br>
JsonPrettyPrint.intermediate.x3d<br>
Json.x3d<br>
Nashorn0.x3d<br>
NashornPrettyPrint.intermediate.x3d<br>
Nashorn.x3d<br>
Node0.x3d<br>
Node.x3d<br>
Quotes.x3d<br>
<br>
X3d.x3d<br>
<br>
<br>
/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/node/examples$" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/node/examples$</a> grep -l <br>
\'\"[^\"]*\"\' *<br>
HelloWorldProgramOutput.Java.x3d<br>
HelloWorldProgramOutput.x3d<br>
Java.x3d<br>
Json.x3d<br>
Node0.x3d<br>
Node.x3d<br>
Quotes.x3d<br>
X3d.x3d<br>
<br>
It was likely that I was struggling over quoting in the nashorn <br>
examples, but my memory is pretty much non-existent about this until I <br>
get back into it.<br>
<br>
<br>
Do people want a typesafe library for loading JavaScript, or something <br>
more like a DOM-based loader?  I'll make a new message for this.<br>
<br>
John<br>
<br>
</blockquote></div></div>