[x3d-public] X3DJSAIL still broken! Fix to XSLT

John Carlson yottzumm at gmail.com
Thu Jul 1 14:52:01 PDT 2021


As reported before CreateX3dSceneAccessInterfaceJava.xslt need a patch 
to set up containerFields for ComposedCubeMapTexture.

Proposed patch here.  Needs testing for other synonym cases. Have been 
unable to confirm that I've actually fixed anything besides JSON.

$ svn diff CreateX3dSceneAccessInterfaceJava.xslt
Index: CreateX3dSceneAccessInterfaceJava.xslt
===================================================================
--- CreateX3dSceneAccessInterfaceJava.xslt      (revision 32276)
+++ CreateX3dSceneAccessInterfaceJava.xslt      (working copy)
@@ -12960,13 +12960,13 @@
              <xsl:text>
          String correctedContainerField;</xsl:text>
              <xsl:for-each 
select="InterfaceDefinition/field[string-length(@synonym) > 0][@type = 
'SFNode']">
-                <xsl:if test="(position() = 1)">
+                <!--xsl:if test="(position() = 1)"-->
                      <xsl:text disable-output-escaping="yes"><![CDATA[
          if (hasAncestorX3D() && 
findAncestorX3D().getVersion().startsWith("3"))
               correctedContainerField = "]]></xsl:text><xsl:value-of 
select="@synonym"/><xsl:text>";
          else correctedContainerField = "</xsl:text> <xsl:value-of 
select="@name"/><xsl:text>";
  </xsl:text>
-                </xsl:if>
+                <!--/xsl:if-->
                  <xsl:variable name="CamelCaseName"><!-- upper camel 
case -->
                      <xsl:value-of 
select="translate(substring(@name,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
                      <xsl:value-of select="substring(@name,2)"/>


=======================================================================================================

Here is the patch to generated output from X3DJSAIL.   Please confirm 
output.

diff --git a/src/main/data/ball.new.x3d b/src/main/data/ball.new.x3d
index 8f9193686..413503e9c 100644
--- a/src/main/data/ball.new.x3d
+++ b/src/main/data/ball.new.x3d
@@ -56,11 +56,11 @@
            </ComposedShader>
            <ComposedCubeMapTexture DEF='texture'>
              <ImageTexture containerField='backTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_back.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_back.png"'/>
-            <ImageTexture containerField='backTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_bottom.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_bottom.png"'/>
-            <ImageTexture containerField='backTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_front.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_front.png"'/>
-            <ImageTexture containerField='backTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_left.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_left.png"'/>
-            <ImageTexture containerField='backTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_right.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_right.png"'/>
-            <ImageTexture containerField='backTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_top.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_top.png"'/>
+            <ImageTexture containerField='bottomTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_bottom.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_bottom.png"'/>
+            <ImageTexture containerField='frontTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_front.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_front.png"'/>
+            <ImageTexture containerField='leftTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_left.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_left.png"'/>
+            <ImageTexture containerField='rightTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_right.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_right.png"'/>
+            <ImageTexture containerField='topTexture' 
url='"../resources/images/all_probes/stpeters_cross/stpeters_top.png" 
"https://coderextreme.net/X3DJSONLD/images/all_probes/stpeters_cross/stpeters_top.png"'/>
            </ComposedCubeMapTexture>
          </Appearance>
          <Sphere/>


I'm having a lot of trouble with these in X_ITE and X3DOM, even with 
XML.  I will start posting better test files.

John




More information about the x3d-public mailing list