[x3d-public] X3DJSAIL still broken!

John Carlson yottzumm at gmail.com
Wed Jun 30 18:15:10 PDT 2021


Example of file produced by X3DJSAIL attached.


coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/python$ python3 
validate.py < ../data/ball.new.json
Traceback (most recent call last):
   File "validate.py", line 9, in <module>
     jsobj = json.loads(sys.stdin.read())
   File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
     return _default_decoder.decode(s)
   File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
   File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
     obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double 
quotes: line 271 column 35 (char 14381)


coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/python$ 
jsonlint ../data/ball.new.json
Error: Parse error on line 270:
...                    { "ImageTexture":
-----------------------^
Expecting 'STRING', got '{'
     at Object.parseError 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:55:11)
     at Object.parse 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:132:22)
     at parse (/usr/local/lib/node_modules/jsonlint/lib/cli.js:82:14)
     at main (/usr/local/lib/node_modules/jsonlint/lib/cli.js:135:14)
     at Object.<anonymous> 
(/usr/local/lib/node_modules/jsonlint/lib/cli.js:179:1)
     at Module._compile (internal/modules/cjs/loader.js:1138:30)
     at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:1158:10)
     at Module.load (internal/modules/cjs/loader.js:986:32)
     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
     at Function.executeUserEntryPoint [as runMain] 
(internal/modules/run_main.js:71:12)


JSON and XML code attached.

Thanks for any help!

John

On 6/30/21 5:26 PM, John Carlson wrote:
>    This code in X3DJSAIL, file ComposedCubeMapTexture.java is still 
> broken with recent upgrade, is corrupting XML and JSON output.  
> Confirmed X3dToJson.xslt is OK!
>
> Input file is attached.
>
> John
>
>   /**
>          * Utility method to adjust field synonyms
>          * @see <a 
> href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#fieldNameChanges">X3D 
> Scene Authoring Hints: X3D4 Field name changes for improved 
> consistency</a>
>      */
>     private void handleFieldSynonyms()
>     {
>         String correctedContainerField;
>         if (hasAncestorX3D() && 
> findAncestorX3D().getVersion().startsWith("3"))
>              correctedContainerField = "back";
>         else correctedContainerField = "backTexture";
>
>         if      (getBackTexture() != null)
>                  ((X3DConcreteNode) 
> getBackTexture()).setContainerFieldOverride(correctedContainerField);
>         else if (getBackTextureProtoInstance() != null)
>                  ((X3DConcreteNode) 
> getBackTextureProtoInstance()).setContainerFieldOverride(correctedContainerField);
>
>         if      (getBottomTexture() != null)
>                  ((X3DConcreteNode) 
> getBottomTexture()).setContainerFieldOverride(correctedContainerField);
>         else if (getBottomTextureProtoInstance() != null)
>                  ((X3DConcreteNode) 
> getBottomTextureProtoInstance()).setContainerFieldOverride(correctedContainerField);
>
>         if      (getFrontTexture() != null)
>                  ((X3DConcreteNode) 
> getFrontTexture()).setContainerFieldOverride(correctedContainerField);
>         else if (getFrontTextureProtoInstance() != null)
>                  ((X3DConcreteNode) 
> getFrontTextureProtoInstance()).setContainerFieldOverride(correctedContainerField);
>
>         if      (getLeftTexture() != null)
>                  ((X3DConcreteNode) 
> getLeftTexture()).setContainerFieldOverride(correctedContainerField);
>         else if (getLeftTextureProtoInstance() != null)
>                  ((X3DConcreteNode) 
> getLeftTextureProtoInstance()).setContainerFieldOverride(correctedContainerField);
>
>         if      (getRightTexture() != null)
>                  ((X3DConcreteNode) 
> getRightTexture()).setContainerFieldOverride(correctedContainerField);
>         else if (getRightTextureProtoInstance() != null)
>                  ((X3DConcreteNode) 
> getRightTextureProtoInstance()).setContainerFieldOverride(correctedContainerField);
>
>         if      (getTopTexture() != null)
>                  ((X3DConcreteNode) 
> getTopTexture()).setContainerFieldOverride(correctedContainerField);
>         else if (getTopTextureProtoInstance() != null)
>                  ((X3DConcreteNode) 
> getTopTextureProtoInstance()).setContainerFieldOverride(correctedContainerField);
>         }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ball.new.json
Type: application/json
Size: 16539 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210630/ccaceeff/attachment-0001.json>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ball.x3d
Type: model/x3d+xml
Size: 9471 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210630/ccaceeff/attachment-0001.x3d>


More information about the x3d-public mailing list