[x3d-public] Possible error in X3dToNodeJS.xslt? LayerSet handling, multiple Mantis issues, class simplification for Java/Node SAI

John Carlson yottzumm at gmail.com
Sat May 30 19:41:40 PDT 2020


X3dToPython.xslt looks good too.  So I imagine it's only X3dToES5.xslt
(deprecated) and X3dToNodeJS.xslt.  Not sure about JSON.

We have several routes:

Make a new translation of X3dToJava.xslt to X3dToNodeJS.xslt.
Make changes to existing X3dToNodeJS.xslt.
Make a stylesheet and serializer for ES6 (library TBD).
Make a stylesheet and serializer for draft ECMAScript SAI spec.  I'm not
sure what we're targeting here.  X3DJSAIL is SAI, and therefore the nodejs
port on top of X3DJSAIL is also SAI.
Do nothing.

I'm not really sure what's preferred.

I don't really want to support stylesheets.  I will support serializers to
provide a second implementation.

I still need to provide a serializer for ES6.  I'm hoping to write an SAX
parser soon.  I have a partially tested SAX-like parser for JSON.

I need to figure out the ES6 constructors.

John



On Sat, May 30, 2020 at 9:11 PM John Carlson <yottzumm at gmail.com> wrote:

> What I've seen is the X3dToJava.xslt does the "addLayerSet" properly.
>
> So we need to upgrade the various stylesheets to how X3dToJava.xslt does
> it.
>
> We can work on this Monday.  Thanks!
>
> John
>
> On Sat, May 30, 2020 at 8:40 AM Don Brutzman <brutzman at nps.edu> wrote:
>
>> 1. Thanks for your notes John.  I've reset our calendar appointment on
>> Mondays for weekly recurrence.
>>
>> Note that Anita intends to consolidate Web3D zoom rooms starting next
>> week.  Once that is in place we can switch our rendezvous coordinates and
>> add this regular review event to the Web3D calendar.
>>
>> 2. Of note regarding LayerSet is that it has a special inheritance
>> hierarchy, which leads to the special handling below.  We likely need to
>> consider and apply your fix for each of the conversion stylesheets.
>>
>> 3. Meanwhile, it turns out that there are 9 active issues on LayerSet in
>> Mantis!  I just connected them as related so that they can be addressed
>> coherently, there is definitely some overlap in there.
>>
>> * Mantis: View Issues, then apply search filter "LayerSet"
>>    https://www.web3d.org/member-only/mantis/view_all_bug_page.php
>>
>> 4. Wondering if you consider "autoclass" a temporary prefix while
>> designing the library.  It will certainly simplify authoring if a
>> programmer can simply say
>>
>>     .addLayerSet((new LayerSet()).setDEF("scene.addChildLayerSetTest"))
>>
>> 5. Corresponding X3DJSAIL Java invocation looks like this:
>>
>>   * Filename:     HelloWorldProgram.java
>>   * Description:  Example "smoke test" program to create an X3D model
>> using the X3D Java Scene Access Interface Library (X3DJSAIL).
>>   * Identifier:
>> https://www.web3d.org/specifications/java/examples/HelloWorldProgram.java
>>
>>         scene.addLayerSet (new
>> LayerSetObject("scene.addChildLayerSetTest")); // string is DEF name
>>
>> It would be a powerful improvement if the Java might become similarly
>> simplified.  Non-trivial, will keep looking at it.
>>
>>         scene.addLayerSet (new LayerSet
>> ("scene.addChildLayerSetTest")); // string is DEF name
>>
>> v/r Don
>>
>>
>> On 5/29/2020 10:43 AM, John Carlson wrote:
>> > This line from my serialized code does the trick.  Let's revisit how to
>> do this in X3dToNodeJS.xslt on Monday.
>> >
>> >          .addLayerSet((new
>> autoclass.LayerSet()).setDEF("scene.addChildLayerSetTest"))
>> >
>> > Will now check in my "repairs."
>> >
>> > John
>> >
>> > On Fri, May 29, 2020 at 12:22 PM John Carlson <yottzumm at gmail.com
>> <mailto:yottzumm at gmail.com>> wrote:
>> >
>> >     java -cp ../jars/X3DJSAIL.4.0.full.jar
>> org.web3d.x3d.jsail.CommandLine examples/HelloWorldProgramOutput.x3d -tojs
>> -toFile examples/HelloWorldProgramOutput.Node.js
>> >     parameter: source file HelloWorldProgramOutput.x3d filesize 22317
>> bytes
>> >     CommandLine parameter: "-tojs" for conversion to X3DJSONLD
>> JavaScript source
>> >     CommandLine parameter: "-toFile"
>> "examples/HelloWorldProgramOutput.Node.js" for result file name root
>> examples/HelloWorldProgramOutput.Node
>> >     Parsing using Document Object Model (DOM) based X3DLoaderDOM...
>> >     [X3DLoaderDOM] <meta name='info' content='continued development and
>> testing in progress'/>
>> >     convert to JS JavaScript:
>> >     Warning: toFileStylesheetConversion(X3dToNodeJS.xslt) is
>> overwriting prior file examples/HelloWorldProgramOutput.Node.js
>> >     className='HelloWorldProgramOutput.Node' has illegal character(s) (
>> -.,;) replaced with '_' underscore character.
>> newClassName='HelloWorldProgramOutput_Node'
>> >     file conversion successful: HelloWorldProgramOutput.Node.js (37121
>> bytes)
>> >
>> >     coderextreme at DESKTOP-DOPK2VD MINGW64 /c/x3d-code/
>> www.web3d.org/x3d/stylesheets/java/node <
>> http://www.web3d.org/x3d/stylesheets/java/node>
>> >     $ node examples/HelloWorldProgramOutput.Node.js
>> >     C:\x3d-code\www.web3d.org <http://www.web3d.org
>> >\x3d\stylesheets\java\node\examples\HelloWorldProgramOu
>> >     tput.Node.js:176
>> >          .addChild((new
>> autoclass.LayerSet("scene.addChildLayerSetTest")))
>> >           ^
>> >
>> >     Error: Could not find method
>> "addChild(org.web3d.x3d.jsail.Layering.LayerSetObje
>> >     ct)" on class "class org.web3d.x3d.jsail.Core.SceneObject".
>> Possible matches:
>> >        public org.web3d.x3d.jsail.Core.SceneObject
>> org.web3d.x3d.jsail.Core.SceneObje
>> >     ct.addChild(org.web3d.x3d.sai.Core.X3DChildNode)
>> >
>> >          at HelloWorldProgramOutput_Node.initialize (C:\x3d-code\
>> www.web3d.org <http://www.web3d.org>\x3d\st
>> >     ylesheets\java\node\examples\HelloWorldProgramOutput.Node.js:176:6)
>> >          at new HelloWorldProgramOutput_Node (C:\x3d-code\www.web3d.org
>> <http://www.web3d.org>\x3d\styleshee
>> >     ts\java\node\examples\HelloWorldProgramOutput.Node.js:123:10)
>> >          at Object.<anonymous> (C:\x3d-code\www.web3d.org <
>> http://www.web3d.org>\x3d\stylesheets\java\node\e
>> >     xamples\HelloWorldProgramOutput.Node.js:484:1)
>> >     ?[90m    at Module._compile
>> (internal/modules/cjs/loader.js:1176:30)?[39m
>> >     ?[90m    at Object.Module._extensions..js
>> (internal/modules/cjs/loader.js:1196:1
>> >     0)?[39m
>> >     ?[90m    at Module.load
>> (internal/modules/cjs/loader.js:1040:32)?[39m
>> >     ?[90m    at Function.Module._load
>> (internal/modules/cjs/loader.js:929:14)?[39m
>> >     ?[90m    at Function.executeUserEntryPoint [as runMain]
>> (internal/modules/run_ma
>> >     in.js:71:12)?[39m
>> >     ?[90m    at internal/main/run_main_module.js:17:47?[39m
>> >
>>
>> 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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200530/09daa6bb/attachment.html>


More information about the x3d-public mailing list