[x3d-public] [x3d] Use of containerField in V4+

Don Brutzman brutzman at nps.edu
Tue Dec 15 03:54:02 PST 2015


containerField describes a node's relationship to its parents.  The default values are typically not needed by authors or generators.

Debate on this topic was a lengthy effort a long time ago. Wrapper tags only simplify rare occurrences,such as Collision node children, distinguishing between a 'proxy' Shape and 'children' Shape nodes.

Extensive reasons against wrapper tags in the XML encoding can be found in
http://www.web3d.org/x3d/content/examples/Basic/development/WrapperTagsConsideredHarmful.html

As a result we have a much terser XML encoding with corresponding reductions in file size, transfer times and scene loading.

Meanwhile, the developmental JSON encoding currently uses the field names directly, similar to the manner that you describe.  Also seems to parse OK.

I think this illustrates the difference between a document-oriented encoding like XML and an object-oriented encoding like JSON.


On 12/14/2015 1:06 PM, Leonard Daly wrote:
> A long (Internet-) time ago, the X3D Working Group came up with the idea of containerField to indicate which child element belonged to which parent field. This only really applies when an X3D node has fields that can be nodes. E.g., Transform can have 'children' to define geometry and appearance and metadata to define metadata. Most of the time the relationship is obvious, especially when a field can can only contain one type of node.
>
> In all of the XML I have seen for many other applications (documents, books, medical records, government records, etc.) do not use that sort of structure. Everything is put into explicit child nodes. That would mean something like Transform would be:
>
> <Transform ...>
>      <children>
>          <Shape>...</Shape>
>          <Shape>...</Shape>
>          <Shape>...</Shape>
>      </children>
>      <metadata>
>          <MetadataString ... />
>          <MetadataFloat ... />
>          <MetadataInteger ... />
>          <MetadataString ... />
>          <MetadataString ... />
>      </metadata>
> </Transform>
>
> This completely eliminate the ambiguity of use without a containerfield with the expense of adding in an extra layer for every use. I think this format is easier to read and certainly parses easier in standard parsers that come with PHP and Perl.
>
> Do other people have any thoughts on this?
>
> --
> *Leonard Daly*
> 3D Systems & Cloud Consultant
> X3D Co-Chair on Sabbatical
> LA ACM SIGGRAPH Chair
> President, Daly Realism - /Creating the Future/

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