[x3d-public] x3d extensions through Metadata

Andreas Plesch andreasplesch at gmail.com
Sun Jul 2 10:45:44 PDT 2023


X3D Browsers may have non-standard extensions such as fields and
nodes. It has been suggested that a backwards compatible way to access
such extensions could be accomplished through Metadata nodes. This way
a X3D file using such extensions still can conform strictly to the
syntactic standard.

It should be possible for browsers to have general and automatic
recognition of such extension fields and nodes provided in Metadata.
Here is a first draft mechanism:

A metadata node would advertise that it is eligible to be considered
as an extension, probably through a reference value of say
"x3dExtension", or by being contained in a special Metadataset with
such a name or reference.

Then a browser would check the Metadata name and if the name is
equivalent to an implemented field of the parent node, the browser
would use the value of the Metadata and use it in some way as the
value of the field (This could also apply to standard fields).

Since Metadata values can only be of type MFString, MFFloat, MFDouble,
MFBool or MFInt32 there needs to be some translation to field values.

Most translations are obvious but SF/MFNode fields are not. One option
is to provide the xml string of an SFNode as the value in a
MetadataString node. But this may be too encoding specific. On the
other hand there is the standard SAI  function createX3DFfromString
for that.

So another option is to use MetadataSet for SFNode. name would still
be the field name for the SFNode. Then the children of MetadataSet
would contain the fields of the SFNode node. In addition there would
be a MetadataString node with name "nodeName" which has the node name
as the value.  This is more verbose but crosses encodings.

MFNode fields would also use MetadataSet. The only children would be
MetadataSet of the SFNode kind.

I will have to check how well that kind of mechanism would fit with
processing of metadata in x3dom. It may not fit that well.

Any feedback, or ideas welcome,

Andreas
-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list