[x3d-public] Problems with create3000/Library model, X3dToJson.xslt, X3dToPython.xslt

John Carlson yottzumm at gmail.com
Sun Jun 26 14:55:55 PDT 2022


https://raw.githubusercontent.com/create3000/Library/main/Tests/Components/ParticleSystems/BoundedPhysicsModel.x3d

Does not pass the X3D validator.

Also see mistranslation of MFBool in XML to JSON.   Probably an issue with
X3dToJson.xslt, but maybe fix the example (below) first.

$ grep true.*false BoundedPhysicsModel.*
BoundedPhysicsModel.json:              "@keyValue":[true,,false]
BoundedPhysicsModel.x3d:        keyValue='true, false'/>

Repaired, but perhaps original above, with comma and space between SFBools
should be translated properly?

$ grep true.*false BoundedPhysicsModel.*
BoundedPhysicsModel.json:              "@keyValue":[true,false]
BoundedPhysicsModel.x3d:        keyValue='true,false'/>

I'm also having issues with translation from JSON to Python (x3djsonld.py)
and X3dToPython.xslt.

I'm getting:

TypeError: 'ColorRGBA' object is not iterable

Example:

ConeEmitter.py
x3d.py package 4.0.64.1 loaded, have fun with X3D Graphics!
Self-test diagnostics:
Traceback (most recent call last):
  File
"C:\Users\john\X3DJSONLD\src\main\python\net\x3djsonld\Library\Tests\Components\ParticleSystems\ConeEmitter.py",
line 92, in <module>
    newModelXML= newModel.XML() # test export method XML() for exceptions
during export
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
14985, in XML
    result += str(self.Scene.XML(indentLevel=indentLevel+1, syntax=syntax))
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
14494, in XML
    result += each.XML(indentLevel=indentLevel+1, syntax=syntax)
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
99941, in XML
    result += self.metadata.XML(indentLevel=indentLevel+1, syntax=syntax)
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
58687, in XML
    result += each.XML(indentLevel=indentLevel+1, syntax=syntax)
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
58687, in XML
    result += each.XML(indentLevel=indentLevel+1, syntax=syntax)
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
58687, in XML
    result += each.XML(indentLevel=indentLevel+1, syntax=syntax)
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
67881, in XML
    for each in self.color:
TypeError: 'ColorRGBA' object is not iterable

The example does not pass the X3D validator, see error error section copied
below (there are other issues).

*4. Performing X3D schema validation <http://www.web3d.org/specifications>
check (X3D schema documentation
<http://www.web3d.org/specifications/X3dSchemaDocumentation3.3/x3d-3.3.html>)
...* Error type: Error SAXParseException: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'ParticleSystem'. One of '{IS,
MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger,
MetadataSet, MetadataString, ProtoInstance}' is expected. Error type: Error
SAXParseException: cvc-complex-type.2.4.a: Invalid content was found
starting with element 'ColorRGBA'. One of '{BoundedPhysicsModel,
TextureCoordinate}' is expected. Error(s) detected during this validation
test. X3D schema validation check: *fail*.

In general, it would be helpful if we could run the X3D validator on
Holger's examples from a script, even if we do screen scraping!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220626/ea24758d/attachment.html>


More information about the x3d-public mailing list