[x3d-public] X3DJSAIL--GeoLOD.setRootNode vs. GeoLOD.addRootNode

John Carlson yottzumm at gmail.com
Wed Apr 13 15:09:14 PDT 2022


Possible issue with X3DJSAIL, GeoLOD.setRootNode (containerField mismatch
for Shape DEF='', found containerField='children' but expected
containerField='rootNode') compared to GeoLOD.addRootNode (validates).
Reading Javadoc, it says there may be multiple rootNodes, so addRootNode
makes sense.

Upon review, there is setRootNode in my Java code, so I'm not sure why
there’s an error (above) running it???

I reviewed the output of X3dToJava.xslt--This uses addRootNode.   Should I
change setRootNode to addRootNode in my serializers?  It won't be the first
time I do something like this.

If I’m doing this solo, ok.   Any clarification why addRootNode validates,
but setRootNode doesn't, would help.   But I’m making mistakes in my
review, feeling a bit scrambled, wondering.  If there will be no changes to
X3DJSAIL, I'll probably have to change my serializers.

I did make a suggestion to use setRootNode to set what goes into the XML
output (containerField=“rootNode” on Shape), but it seems like that
suggestion has fallen on deaf ears.  That is, we want to bury
containerField, but it keeps cropping up.  Can we do something better with
X3DJSAIL (and serializers) than subverting the programmer's intention?

I will take a peek at X3DUOM now.  It looks like the default container
Field for shape (which I think is the node in question), is set to
"children".  I can't recommend a better default containerField value.

In my serializers, I think I purposefully use setRootNode on the first
child, but I will have to double check.

It would seem like if the container field has type MFNode, I should use add.

On Sat, Apr 9, 2022 at 7:43 PM John Carlson <yottzumm at gmail.com> wrote:

> interesting "issues" while running Java generated by JavaSerializer.js.
> Sample attached.
>
> Note that the SquawLOD023.x3d.new (intermediate between JSON and Java)
> does not contain the containerField='rootNode' that the XML file has.
> Should I explicitly set the containerField on Shape?
>
> Note that the .new.json does not contain a containerField either, nor does
> the JSON generated from XML, that the serializer uses as input.
>
> Can someone explain why the containerField was supposed to be 'rootNode'?
>  Can we get the X3dToJson.xslt to produce a rootNode containerField for
> this case?
>
>
> I'm guessing this is on a TODO list somewhere.
>
>
>
> ~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
>
> net/coderextreme/x3d_code/www_web3d_org/x3d/content/examples/Basic/Geospatial/SquawLOD023
> success... containerField mismatch for Shape DEF='', found
> containerField='children' but expected containerField='rootNode'
> ~/X3DJSONLD/src/main/shell
> ~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
>
> net/coderextreme/x3d_code/www_web3d_org/x3d/content/examples/Basic/Geospatial/SquawLOD024
> success... containerField mismatch for Shape DEF='', found
> containerField='children' but expected containerField='rootNode'
> ~/X3DJSONLD/src/main/shell
> ~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
>
> net/coderextreme/x3d_code/www_web3d_org/x3d/content/examples/Basic/Geospatial/SquawLOD025
> success... containerField mismatch for Shape DEF='', found
> containerField='children' but expected containerField='rootNode'
> ~/X3DJSONLD/src/main/shell
> ~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
>
> net/coderextreme/x3d_code/www_web3d_org/x3d/content/examples/Basic/Geospatial/SquawLOD026
> success... containerField mismatch for Shape DEF='', found
> containerField='children' but expected containerField='rootNode'
> ~/X3DJSONLD/src/main/shell
> ~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
>
> net/coderextreme/x3d_code/www_web3d_org/x3d/content/examples/Basic/Geospatial/SquawLOD027
> success... containerField mismatch for Shape DEF='', found
> containerField='children' but expected containerField='rootNode'
> ~/X3DJSONLD/src/main/shell
> ~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
>
> net/coderextreme/x3d_code/www_web3d_org/x3d/content/examples/Basic/Geospatial/SquawLOD028
> success... containerField mismatch for Shape DEF='', found
> containerField='children' but expected containerField='rootNode'
> ~/X3DJSONLD/src/main/shell
> ~/X3DJSONLD/src/main/java ~/X3DJSONLD/src/main/shell
>
> net/coderextreme/x3d_code/www_web3d_org/x3d/content/examples/Basic/Geospatial/SquawLOD029
> success... containerField mismatch for Shape DEF='', found
> containerField='children' but expected containerField='rootNode'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220413/f45c326a/attachment.html>


More information about the x3d-public mailing list