[x3d-public] X3dToJson.xslt. Outstanding bug (corrected reply)

Don Brutzman brutzman at nps.edu
Sun Dec 6 13:16:55 PST 2015


Fix of interest is now deployed in X3D-Edit as well.

> There’s an issue with the MFRotation field being a string versus and array when a value is used. Here is a sample file you can use
> . (bubbles.x3d) to translate to JSON to see the problem. Thanks!

I have also improved X3D Schematron and updated X3D Validator to warn about comma-itis.

Here are latest diagnostics for bubbles.json example.

https://savage.nps.edu/X3dValidator
=======================================
<Script name='' DEF='RandomTourTime'> <field name='orientations' type='MFRotation' accessType='inputOutput' value='0,1,0,0,0,1,0,-1.57,0,1,0,3.14,0,1,0,1.57,0,1,0,0,1,0,0,-1.57,0,1,0,0,1,0,0,1.57,0,1,0,0'/> has unexpected number of commas (expected zero or 8, found 35) for 9 singleton values found in this 4-tuple type MFRotation. Avoid including commas within individual SF single-field values that make up n-tuple MF multiple-field arrays. [/X3D/Scene/Script/field[3], warning]

<Script name='' DEF='RandomTourTime'> <field name='positions' type='MFVec3f' accessType='inputOutput' value='0,0,10,-10,0,0,0,0,-10,10,0,0,0,0,10,0,10,0,0,0,10,0,-10,0,0,0,10'/> has unexpected number of commas (expected zero or 8, found 26) for 9 singleton values found in this 3-tuple type MFVec3f. Avoid including commas within individual SF single-field values that make up n-tuple MF multiple-field arrays. [/X3D/Scene/Script/field[4], warning]
=======================================


On 12/5/2015 7:48 PM, Don Brutzman wrote:
> thanks for the test scene, very helpful.
>
> On 12/4/2015 9:00 PM, John Carlson wrote:
>> Don I downloaded the most recent stylesheet and saw no changes.  There’s an issue with the MFRotation field being a string versus and array when a value is used.  Here is a sample file you can use
>> .  (bubbles.x3d) to translate to JSON to see the problem.  Thanks!
>
> the current online and checked-in version of the stylesheet appears to work.
>
> http://www.web3d.org/x3d/stylesheets/X3dToJson.xslt
> https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJson.xslt
>
> bubbles.json output attached.
>
> i will try to run an update of X3D-Edit that includes it.  meanwhile X3D-Edit also lets you use the XSLT arrow "->" button to launch a locally saved stylesheet, be sure to provide the right file extension.
>
> am also noticing some idiosyncracies in the .x3d source, preferred schema whitespace for multiple-value numeric types is to only use commas between each tuple, i.e. no commas in SFRotation and only commas between contained SFRotation values in MFRotation arrays.  looks like your field initializations are slipping through X3D Schematron, will try to add some rules for those.

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



More information about the x3d-public mailing list