[x3d-public] X3D JSON Schema warnings and validation automation progress

John Carlson yottzumm at gmail.com
Sun Mar 27 10:09:57 PDT 2016


Here’s a schema replacing tabs with spaces.  Very easy to do in vim (you should use it! :).  Thanks Roy for developing the schema!

https://raw.githubusercontent.com/coderextreme/X3DJSONLD/master/x3d-3.3-JSONSchema.json <https://raw.githubusercontent.com/coderextreme/X3DJSONLD/master/x3d-3.3-JSONSchema.json>


You can do a diff -w on the new and old files to confirm they are the same (I haven’t tested, so there may be an issue, especially if any of the actual schema contained tabs).  I didn’t just replace leading tabs, in other words.  Will run this through some schema tests now.

John

On Mar 27, 2016, at 12:52 PM, Don Brutzman <brutzman at nps.edu> wrote:
> 
> On 3/27/2016 5:36 AM, Roy Walmsley wrote:
>> Don,
>> 
>> I'm assuming that the tabs were added automatically by XMLSpy, as I generated everything graphically. When I do the auto-generation (and I'm starting to think about that now) I'll ensure that I use spaces, not tabs. In the meantime, are you happy to continue with the --white command line switch?
> 
> Whitespace can be a tricky business in JSON.  Douglas Crockford is very assertive over what he thinks is best and does not hesitate to impose that unilaterally in jslint.  In part this is motivated by javascript tool pathologies, not just perceived coding style.  I found several places where people disagreed with his whitespace rules and disliked that there was not finer-grained control to ignore some aspects (e.g. allow tabs instead of space characters).
> 
> 	http://jslint.com
> 
> In addition to detailed explanations of rules and relaxations, he politely warns people that they may get really upset.
> 
> http://jslint.com/help.html
> =================================================================================
> [...]
>> Please let me know if JSLint is useful for you. Is it too strict? Is there a check or a report that could help you to improve the quality of your programs? douglas at crockford.com. But please don't ask me to dumb JSLint down or to make it more forgiving of bad practices. You would only be disappointed.
>> 
>> I intend to continue to adapt JSLint based on your comments. Keep watching for improvements. Updates are announced at https://plus.google.com/communities/104441363299760713736.
> [...]
>> Perfectly fine
>> 
>> JSLint was designed to reject code that some would consider to be perfectly fine. The reason for this is that JSLint's purpose is to help produce programs that are free of error. That is difficult in any language and is especially hard in JavaScript. JSLint attempts to help you increase the visual distance between correct programs and incorrect programs, making the remaining errors more obvious. JSLint will give warnings about things that are not necessarily wrong in the current situation, but which have been observed to mask or obscure errors. Avoid those things when there are better options available.
>> 
>> It is dangerous out there. JSLint is here to help.
>> 
>> Warning
>> 
>> JSLint will hurt your feelings. Side effects may include headache, irritability, dizziness, snarkiness, stomach pain, defensiveness, dry mouth, cleaner code, and a reduced error rate.
> =================================================================================
> 
> The jshint project appears in some part motivated by these differences in opinion.  They further warn that turning off jslint whitespace checking will allow some problems to pass through.
> 
> 	http://jshint.com
> 
> Recommendation: as usual, let's be "strict about what we produce and lenient about what we accept."  So for X3D JSON Schema, and X3dToJson.xslt conversion outputs, let's work to match the strict (no variation) whitespace rules that jslint advocates.  That way anyone else using these X3D products doesn't have to worry about whitespace at all.
> 
> If XML Spy lets you clean up schema whitespace in that fashion, then great.  I can then remove the "--white" command-line switch.  If it doesn't have that option, then let me double-check with you and then we can submit an issue report to them for future improvement.
> 
> If the whitespace issue is at all difficult or time-consuming to fix, then let's leave it alone and address the problem later when we begin to autogenerate the X3D JSON schemas, version by version, from the X3D XML Schema-generated X3D Object Model.
> 
> Best-case scenario: we eventually pass all validation tools without hiccups.
> 
>> Great work with the validation!
>> 
>> Regards,
>> 
>> Roy
> 
> Thanks again Roy for the super job on the X3D JSON Schema, another big step forward for all of us.  8)
> 
> 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/20160327/c037b766/attachment-0001.html>


More information about the x3d-public mailing list