[x3d-public] X3dToPython.xslt/x3d.py and X3dToJson.xslt

John Carlson yottzumm at gmail.com
Mon Jul 31 10:04:32 PDT 2023


There's an issue with multiline comments in X3dToPython.xslt and
X3dToJson.xslt and multi-line comments:

 Produced Python (oops, need more comment characters, or use Comment class,
Comment(value=''' fill in comment here ''')).

   Group(
      #  DEFS for markers of skeleton joints, segments, and sites
      children=[
      Transform(
        #
  <Transform translation='0 2 0' scale='1 1 1'>
   <Shape DEF='HAnimRootShape'>
    <Sphere radius='0.02'  />
     <Appearance>
      <Material DEF='HAnimRootMaterial' diffuseColor='0.8 0 0'
transparency='0.3'/>
     </Appearance>
    </Shape>
  </Transform>
====================================
Original code:

<Group> <!-- DEFS for markers of skeleton joints, segments, and sites -->
 <Transform translation='0 0 0' scale='1 1 1'>
<!--
  <Transform translation='0 2 0' scale='1 1 1'>
   <Shape DEF='HAnimRootShape'>
    <Sphere radius='0.02'  />
     <Appearance>
      <Material DEF='HAnimRootMaterial' diffuseColor='0.8 0 0'
transparency='0.3'/>
     </Appearance>
    </Shape>
  </Transform>
  -->
======================================================
Here's how x3djsonld.py handles it from the JSON (sorry about missing
indents), but there are other issues, like missing newlines.

Group(children=[
Comment(value=''' DEFS for markers of skeleton joints, segments, and sites
'''),
Transform(children=[
Comment(value=''' <Transform translation='0 2 0' scale='1 1 1'> <Shape
DEF='HAnimRootShape'> <Sphere radius='0.02' /> <Appearance> <Material
DEF='HAnimRootMaterial' diffuseColor='0.8 0 0' transparency='0.3'/>
</Appearance> </Shape> </Transform> '''),
Transform(translation=((0,2.1,0)), children=[
Shape(DEF="HAnimJointShape",
geometry=
Sphere(radius=0.02),
appearance=
Appearance(
material=
Material(DEF="HAnimJointMaterial", diffuseColor=((0,0,0.8)),
transparency=0.3)))]),
===============================================================
Here's the JSON (note, no quoted newlines), so possible issue with
X3dToJson.xslt

          { "Group":
            {
              "-children":[
                {
                  "#comment":"DEFS for markers of skeleton joints,
segments, and sites"
                },
                { "Transform":
                  {
                    "-children":[
                      {
                        "#comment":"<Transform translation='0 2 0' scale='1
1 1'> <Shape DEF='HAnimRootShape'> <Sphere radius='0.02' /> <Appearance>
<Material DEF='HAnimRootMaterial' diffuseColor='0.8 0 0'
transparency='0.3'/> </Appearance> </Shape> </Transform>"
                      },
                      { "Transform":
                        {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230731/f156ccfd/attachment.html>


More information about the x3d-public mailing list