[x3d-public] JSON Script encoding [was announce: updated encoding, X3D to JSON Stylesheet Converter: string arrays, whitespace, UTF-8, Script #source]

Don Brutzman brutzman at nps.edu
Wed Nov 25 17:11:12 PST 2015


Hi John.  I checked and tested a number of scenes, the Scene tag looks OK and they are all continuing to pass without throwing jslint errors.

I believe that the problem is in your Scene tag, it is not supposed to have attributes.  There are no corrolaries for those in other encodings.  Though I suppose we might well expect to have them since a <Scene> element might get decorated with attributes by DOM operations or other editing.

Similar situation exists for elements head, Scene, ProtoBody and IS.  The current encoding treats those as containing simple objects rather than containing an array.

I recommend taking the attribute off of Scene (if possible) so that you can proceed, and we think about this some more.  Am hesitant before opening a door that might encourage otherwise-invalid X3D content.


On 11/25/2015 3:07 PM, John Carlson wrote:
> Don, the stylesheet in X3D-Edit and the one I downloaded from here http://www.web3d.org/x3d/stylesheets/ <http://www.web3d.org/x3d/stylesheets/>*X3dToJson*.*xslt both produce this JSON which has a bad Scene object.*
> *
> *
> *Note the object which is used as a key in the Scene:*
> *
> *
> *“Scene”: { {*
> *
> *
> *The second brace is illegal.  Please get a JSON parser or jsonlint-lines and use it.  Original X3D is include below:*
> *
> *
> *John*
>
>
> { "X3D": {
>      "@id":"x3dElement",
>      "@showStat":false,
>      "@showLog":false,
>      "@style":"width:100%; height:100%; border:0; margin:0; padding:0;",
>      "@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.3.xsd",
>      "Scene": {
>        {
>          "@DEF":"scene",
>          "-children":[


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



More information about the x3d-public mailing list