[x3d-public] Ouch, x3d.py XML output does not list required fields in unit and component

John Carlson yottzumm at gmail.com
Fri Apr 7 16:55:08 PDT 2023

Not a JSON issue!

Waiting for some kind of acknowledgment of receipt at least.  Seems like a
less pressing issue (missing required fields) if people are producing X3DOM
and X_ITE using x3d.py
What happens with missing required fields— except assigning a default value?

This really seems very low priority, but the UX has something to be
desired, as I’m comparing output XML to original.   I currently am only
processing one scene, HelloWorldProgramOutput.*.

I was told to hold off on flow of bug reporting.  I know that I’m not the
best elucidator.   I’m focusing on one issue at a time, the best i can.

I fully realize that this is a complex issue and solving it may add excess
bloat, so I would encourage making the bug fix an optional feature?  Can we
weave required outputs into an optional optimized library?   This seems to
be a cross-cutting concern which might be solved with aspects, if that
subject is not a hot potato?

While I do focus on JSON input for X3DJSAIL and x3d.py, I aim to report on
more general issues I’m seeing with sourceforge code.


On Mon, Apr 3, 2023 at 9:43 AM John Carlson <yottzumm at gmail.com> wrote:

> Here's a small python program which shows the issue. Note that required
> fields level=1 and conversionFactor=1.0 are not shown in XML output, but
> they are in the python program.
> Thanks!
> John
> # x3d.py package loaded, have fun with X3D Graphics!
> print("<!--")
> from x3d import *
> print("-->")
> print(
> X3D(class_="x3dModel.class", profile="Full", style_="x3dModel.style",
> version="4.0",
> head=head(children=[component(name="Navigation", level=3),
> component(name="Shaders", level=1),
> component(name="CADGeometry", level=2),
> unit(name="LengthUnitConversion", category="length", conversionFactor=1.0),
> unit(name="ForceFromPoundsToNewtons", category="force",
> conversionFactor=4.4482),
> ]),
> Scene=Scene())
> .XML())
> On Mon, Apr 3, 2023 at 9:17 AM John Carlson <yottzumm at gmail.com> wrote:
>> Low impact issue in x3d.py at this point:
>> Does one even need to list the component or unit nodes if level and
>> conversionFactor fields are defaulted? Note: the fields are required.  If a
>> defaulted, but required field is reset in a python program, should the
>> default be in XML output? I would like it so.  See attached python program.
>> I'll do the tooltip thing.
>> X3D Tooltips in English version 4.0 (web3d.org)
>> <https://www.web3d.org/x3d/content/X3dTooltips.html#unit.conversionFactor> --
>> conversionFactor is required!
>> X3D Tooltips in English version 4.0 (web3d.org)
>> <https://www.web3d.org/x3d/content/X3dTooltips.html#component.level> --
>> level is required
>> X3DUOM says use="required" for both fields.
>> Should I check XML schema?
>> This is why program output needs to be validated and verified, especially
>> if it's a program!
>> Luckily, I'm hoping this doesn't affect much, probably just x3d.py and an
>> xslt.
>> Thanks!
>> John
>> <component level='3' name='Navigation'/>
>>     <component name='Shaders'/>
>>     <component level='2' name='CADGeometry'/>
>>     <component level='2' name='DIS'/>
>>     <component name='H-Anim'/>
>>     <component name='Grouping'/>
>>     <component name='Layering'/>
>>     <unit category='angle' name='AngleUnitConversion'/>
>>     <unit category='length' name='LengthUnitConversion'/>
>>     <unit category='force' conversionFactor='4.4482'
>> name='ForceFromPoundsToNewtons'/>
>>     <meta content='HelloWorldProgramOutput.x3d' name='title'/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230407/f3452840/attachment.html>

More information about the x3d-public mailing list