<div dir="ltr">Thanks. Not sure if importDocument would be very relevant outside of a web browser but it could be, especially if transpiled to JS.<div><br></div><div>Looking back at setUSE, I do not think one can modify an already existing USE reference with SAI. Instead, get a node (with its DEF name), <a href="http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#getNode">http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#getNode</a>, and insert it with field.setValue, <a href="http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#setValue">http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#setValue</a>, overwriting an existing reference.</div><div><br></div><div>One does the same for the initial construction of the scene. First, create a node with a DEF name, then use it to set the field values where ever it is used:</div><div>Instead of </div><div>nodetype.setUSE('defName')</div><div>it becomes</div><div>field.setValue(scene.getNode('defName'))</div><div><br></div><div>I think one could follow the same procedure in case of root nodes but I am not sure if there is a situation where you want duplicate (DEF and USE) root nodes.</div><div><br></div><div>So I seem to agree with Roy that setUSE is not necessary and perhaps incompatible. One complication it would introduce is that it becomes necessary to check if the reference DEF name actually exists and if the referenced node is of the same type as the provided node type. Another complication is that now setUSE is also responsible for checking namescopes.</div><div><br></div><div>In order to serialize out USEd nodes, one would first see if the node to serialize is a reference to an existing node. If it is, look up the DEF name and type and serialize as type USE=name.</div><div><br></div><div>I feel I am missing something,</div><div><br></div><div>Andreas</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 21, 2017 at 11:44 AM, Don Brutzman <span dir="ltr"><<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7/20/2017 3:02 PM, Andreas Plesch wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
SAI has importDocument<br>
<br>
<a href="http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#importDocument" rel="noreferrer" target="_blank">http://www.web3d.org/documents<wbr>/specifications/19777-2/V3.3/<wbr>Part2/functions.html#<wbr>importDocument</a><br>
<br>
where document is a DOM node org.w3c.dom.Node<br>
</blockquote>
<br>
added on the TODO list<br>
<a href="http://www.web3d.org/specifications/java/X3DJSAIL.html#TODO" rel="noreferrer" target="_blank">http://www.web3d.org/specifica<wbr>tions/java/X3DJSAIL.html#TODO</a><br>
<br>
v/r Don<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div>