[x3d-public] comments in USE nodes

Don Brutzman brutzman at nps.edu
Wed Oct 25 08:04:27 PDT 2017


On 10/24/2017 10:38 PM, John Carlson wrote:
> One of these errors brought up an issue:  We should probably allow -children along with @USE if the children are comments.   What do you think?

Seems plausible.

>  Can someone craft a schema item that I can put into all nodes?  Making it a ref would reduce the amount of code.

That is good practice, I think Roy has a number of such comments.

> This may be a standards issue, whether to allow comments in USE nodes.

Well, let's look at the content.  USE references are very terse, regardless of encoding:

	material USE DeepBlue

	<Material USE="DeepBlue" containerField="Material"/>

Pretty sparse.  Now let's add a comment.  Possible forms:

A.	material USE DeepBlue # what else?

b.	<Material USE="DeepBlue" containerField="Material">
		<!-- what else? -->
	</Material>
or

C.	<Material USE="DeepBlue" containerField="Material">
	<!-- what else? -->

When comparing the [Classic]VRML syntax with XML syntax, the comment might just as well be considered to follow the node (rather than be part of the node).

If we try to round trip these constructs, both cases B and C map back to case A.

So for USE, it is possible to not have a child comment (case C) without losing expressiveness.

Suggested balance: maximize simplicity and consistency.  For USE comments, I think case C is appropriate and the corresponding JSON is do-able.

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



More information about the x3d-public mailing list