[x3d-public] Possible problem with X3dToJava.xslt, extra commas in coord Inex

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Sun Jul 30 12:21:00 PDT 2023


Have made stylesheet more tolerant of excess commas in XML .x3d models (which are XML schema invalid and typically cleaned up by C14N canonicalization).

 

Committed change to X3dToJava.xslt stylesheet:

*	MFBool, MFInt32 output: first strip excess commas, then normalize-space, then insert commas

 

MF float/double/etc. are handled differently, seemed to work on spot checks I performed.

 

X3D-Edit indeed includes X3dToJava.xslt conversion – see menu X3D-Edit > Export X3D model to file > Java or else steaming coffee cup button on toolbar.

 

Thanks for another excellent example.

 

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 https://faculty.nps.edu/brutzman

 

From: John Carlson <yottzumm at gmail.com> 
Sent: Saturday, July 29, 2023 3:44 AM
To: X3D Graphics public mailing list <x3d-public at web3d.org>; Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; Holger Seelig <holger.seelig at gmail.com>
Subject: Possible problem with X3dToJava.xslt, extra commas in coord Inex

 

I'm getting extra comments in the java code generated by X3dToJava.xslt.

 

Apparently there's no X3D to Java in X3D-Edit?

 

Here's some sample generated Jav (see extra commas):

 

.setGeometry(new IndexedFaceSet("Backing").setDEF("Backing").setCoordIndex(new int[] {0,,1,,2,,3,,-1})

 

.setGeometry(new IndexedLineSet().setCoordIndex(new int[] {0,,1,,-1,,0,,2,,-1,,0,,3,,-1})

.

Here's the XML (I believe this is from Holger, because it has her name on it).

              <IndexedFaceSet DEF='Backing'

                  coordIndex='0, 1, 2, 3, -1'>

                <Coordinate

                    point='-0.2 -0.25 -0.01, 3 -0.25 -0.01, 3 1 -0.01, -0.2 1 -0.01'/>

              </IndexedFaceSet>

 

setPoint is OK in the Java, it's the setCoordIndex and setSkinCoordIndex.

 

Recommendations:

 

1) X3dToJava.xslt should not add commas when commas are already there. Perhaps strip commas before adding them?  With both setCoordIndex and setSkinCoordIndex

 

2) Holger's x3d-tidy should not introduce commas if they are not already there (I'm fairly sure the original is some form of VRML.  The VRML file appears to be the oldest of relevant file names.

 

3) If Joe wants to provide the file, it's JoeLevel2LOA3SSPYRWRJKHud.x3dv, I think.

 

I'm going to delete the Java code because I'm having issues with my new gradle build.

 

More to come, we get better and better with each new example!

 

Thanks!

 

John

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230730/54324457/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5464 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230730/54324457/attachment-0001.p7s>


More information about the x3d-public mailing list