[x3d-public] x3d.py roundtrip for Metadata nodes in v.3.3 and v.4.0

John Carlson yottzumm at gmail.com
Tue Oct 31 13:22:51 PDT 2023


Thanks, Vince,

Yes, x3d.py reorders fields on output, even if they are specified in order
in the python constructor call the authors/programmers create.   The
author/programmer cannot force an order of fields in the output from x3d.py
without changing x3d.py, perhaps through subclassing.  That might be the
best solution at this point.

John

On Tue, Oct 31, 2023 at 2:45 PM Vincent Marchetti <vmarchetti at kshell.com>
wrote:

> I have another set of example files reproducing the issue that Andreas and
> John have identified with creating X3D xml encoding files using the x3d.py
> package.These examples are a little bit simpler in that the python code
> which uses the x3d.py is more explicitly available as an illustrative
> example. I believe it's been clarified in Andreas' and John's messages that
> the problem is not that x3d.py produces invalid X3D, it is that the X3D
> output from x3d.py produces valid X3D that does not represent the meaning
> that the author desired.
>
> As has been noted, the problem arises in representing a MetadataSet node
> that itself has a non-null metadata field value.
> The file CalendarMetadara.x3d is an X3D file that correctly represents my
> intent
>
> The relevant X3D fragment from this file is:
> <MetadataSet containerField='metadata' name="birthday" reference="
> https://www.archives.gov/legislative/features/washington">
> <MetadataString containerField='metadata' name="calendar"
> value='"Julian"'/>
> <MetadataInteger containerField="value" name="day" value="11"/>
> <MetadataInteger containerField="value" name="month" value="2"/>
> <MetadataInteger containerField="value" name="year" value="1731"/>
>
> To make the purpose of each Metadata node I have by hand added a
> containerField xml attribute to each element.
> This file is not part of my example set; I am not concerned . at least
> here, with how this can be converted to python encoding. This file just
> shows what I am trying to generate using x3d.py
>
>
> The python code, which I judge should reproduce this example, or at least
> equivalent X3D depending on choice of defaults, is in file
> GenerateCalendarMetadata.py, with the relevant section
>
>     WorldInfo(      metadata = MetadataSet(
>                     name="birthday",
>                     reference="
> https://www.archives.gov/legislative/features/washington",
>                     metadata=MetadataString(name="calendar",
> value=["Julian"]),
>                     value=[ MetadataInteger(name="day" ,  value=[11]),
>                             MetadataInteger(name="month", value=[2]),
>                             MetadataInteger(name="year", value=[1731])
>                           ]
>                     )
>             )
>
> The output of the completed script is in file
> GeneratedCalendarMetadata.x3d, relevant section is:
>
>   <MetadataSet name='birthday' reference='
> http://www.americaslibrary.gov/jb/colonial/jb_colonial_washingtn_2.html'>
>         <MetadataString name='calendar' value='"Julian"'/>
>         <MetadataInteger name='day' value='11'/>
>         <MetadataInteger name='month' value='2'/>
>         <MetadataInteger name='year' value='1731'/>
>       </MetadataSet>
>
> The point of the example is that there is no general choice of default
> values of containerField attribute in which this X3D fragment has the same
> meaning as in CalendarMetadata.x3d or with the intent as represented in the
> python code.
>
>
>
>
>
>
>
>
> Vince Marchetti
>
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20231031/5532186d/attachment.html>


More information about the x3d-public mailing list