[x3d-public] X3D XML Encoding lacks -explicit- support for NULL nodes

Don Brutzman brutzman at nps.edu
Thu Dec 10 15:03:45 PST 2015


[modified subject line for precise understanding]

Hi Holger, interesting problem.  Can we break it down and put it back together please.

First, there is implicit support for NULL nodes in Script, ProtoDeclare, and ProtoInstance declarations.  Namely, any SFNode/MFNode initializations for <field></field> and <fieldValue></fieldValue> can simply be left empty.

Second, a point of information.  X3D Schematron will report a warning that an SFNode/MFNode initialization is empty, but can be silenced if an author puts a comment in.  Example:

<Script name='nullExample'>
  <field name='nihil' accessType='initializeOnly' type='SFNode'><!-- intentionally NULL --></field>
  <!-- etc. -->
</Script>

Third, XML Recommendation syntax says that empty elements are the same as singleton elements.  (X3D Canonicalization C14N will deliberately combine empty elements into singletons for consistency.)  Equivalent examples:

	<Transform/>
and
	<Transform><Transform/>

Fourth, I've never seen an example like yours but imagine it might be definable using ClassicVRML syntax.  Wondering, can you think of an example use case where an author might need this construct?

Fifth, also wondering if your example including <NULL/> pseudo-elements is considered equivalent to the following scene subgraph?

<Script>
   <field accessType='inputOutput' type='MFNode' name='matrix'>
      <Transform USE='A'/>
      <Transform USE='B'/>
      <Transform USE='C'/>
   </field>
</Script>

Appreciate your diligence in exploring this issue.


On 12/10/2015 12:31 PM, Holger Seelig wrote:
> Rewrote the X3D XML example,
> And is there support for NULL nodes in JSON Encoding considered?
>
> <Script>
>    <field accessType='inputOutput' type='MFNode' name='matrix'>
>       <Transform USE='A'/>
>       <NULL/>
>       <Transform USE='B'/>
>       <NULL/>
>       <Transform USE='C'/>
>    </field>
> </Script>
>
> Am 10.12.2015 um 21:14 schrieb Holger Seelig:
>> The X3D XML Encoding lacks support for NULL nodes.
>>
>> Althought it is possible with X3D Classic Encoding to write:
>>
>> Script {
>>    inputOutput MFNode matrix [ USE A, NULL, USE B, NULL, USE C ]
>> }
>>
>> it is not possible to do this in X3D XML Encoding, and therefore there
>> should probably something like a NULL-tag <NULL>.
>>
>> <Script>
>>    <field accessType='inputOutput' type='MFNode' name='matrix'>
>>       <Script USE='A'/>
>>       <NULL/>
>>       <Script USE='B'/>
>>       <NULL/>
>>       <Script USE='C'/>
>>    </field>
>> </Script>

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