<div dir="ltr"><p dir="ltr"></p>
<p dir="ltr">On Oct 22, 2016 6:27 PM, "Don Brutzman" <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br>
><br>
> On 10/22/2016 10:34 AM, Andreas Plesch wrote:<br>
>><br>
>> Don,<br>
>> thanks for taking the time to look this up.<br>
>><br>
>> So, xj3d returns a scene which can be used in replaceWorld just as the spec. says.<br>
>><br>
>> This is how cobweb implements importDocument and how cobweb_dom loads the (initial) scene.<br>
>><br>
>> Andreas<br>
><br>
><br>
> outstanding.  when adding that capability, i will be making sure X3D SAI Java Library does the same.<br>
><br>
> Open issues and possibilities:<br>
><br>
> - loading scene fragments</p>
<p dir="ltr">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.</p>
<p dir="ltr">I was expecting a createX3DfromDOM service but importDocument may have been intended to fill this role.</p><p>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. <br></p>
<p dir="ltr">> - loading HTML that contains embedded X3D scene</p>
<p dir="ltr">parsing HTML into a DOM is very available. I am not quite sure what scenario you would have in mind here.</p>
<p dir="ltr">> - loading Shape Resource Container (SRC) model</p>
<p dir="ltr">Or glTF ? X3dom just got support for that. It has ExternalGeometry and ExternalShape nodes for this purpose.<br></p>
<p dir="ltr">> - loading importer results (again X3D scenes or scene fragments)</p>
<p dir="ltr">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.<br></p>
<p dir="ltr">> am thinking about how X3D Schematron, X3D Validator and X3D Tidy might handle these kinds of cases.</p>
<p>What do you have in mind ? Looking inside the resources to be imported ?<br></p>
<p dir="ltr">> Perhaps they should be SAI utility methods as well, at least informal additions in implementations for experimentation.</p>
<p dir="ltr">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.<br></p>
<p>-Andreas<br></p>
</div>