[x3d-public] browser importDocument SAI service

Andreas Plesch andreasplesch at gmail.com
Sat Oct 22 20:35:15 PDT 2016


On Oct 22, 2016 6:27 PM, "Don Brutzman" <brutzman at nps.edu> wrote:
>
> On 10/22/2016 10:34 AM, Andreas Plesch wrote:
>>
>> Don,
>> thanks for taking the time to look this up.
>>
>> So, xj3d returns a scene which can be used in replaceWorld just as the
spec. says.
>>
>> This is how cobweb implements importDocument and how cobweb_dom loads
the (initial) scene.
>>
>> Andreas
>
>
> outstanding.  when adding that capability, i will be making sure X3D SAI
Java Library does the same.
>
> Open issues and possibilities:
>
> - loading scene fragments

While the spec. mentions document fragments as a dom argument for
importDocument, it does not say if the dom to be imported can be an
incomplete scene or scene fragment, similar to createX3DfromString.

I was expecting a createX3DfromDOM service but importDocument may have been
intended to fill this role.

Using the XML encoding most x3d statements are obvious in how they are
derived from a DOM although strictly speaking in the HTML DOM all x3d nodes
are HTMLUnknownElements. Script is perhaps the only node which may need
specific treatment in an importDocument or createX3DfromDOM spec.

> - loading HTML that contains embedded X3D scene

parsing HTML into a DOM is very available. I am not quite sure what
scenario you would have in mind here.

> - loading Shape Resource Container (SRC) model

Or glTF ? X3dom just got support for that. It has ExternalGeometry and
ExternalShape nodes for this purpose.

> - loading importer results (again X3D scenes or scene fragments)

I think currently the SAI only expects root nodes to be added to an
existing scene from importer results, eg. imported scene root nodes. On the
other hand, the SAIScene created by createX3DfromString is used in scripts
as a way to add field values anywhere from what I have seen.

> am thinking about how X3D Schematron, X3D Validator and X3D Tidy might
handle these kinds of cases.

What do you have in mind ? Looking inside the resources to be imported ?

> Perhaps they should be SAI utility methods as well, at least informal
additions in implementations for experimentation.

Currently, it is convenient for cobweb_dom if not necessary to use internal
cobweb non-SAI methods to deal with adding nodes as field values somewhere
in the scene graph. There may be room for such SAI utility methods.

-Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20161022/af98d758/attachment.html>


More information about the x3d-public mailing list