[x3d-public] x3d.py SFVec3f toXML keeps parens

Andreas Plesch andreasplesch at gmail.com
Sat Apr 25 12:46:43 PDT 2020


Thanks for looking into this. I think round-trip tests would mean:

- run generated python
- use .toXML() on the document, eg. the X3D object.
- regenerate python from the produced XML, with the stylesheet.
- look for errors
- run regenerated python, perhaps do another cycle

Perhaps as an intermediate step, just validating the generated XML
would suffice to catch a lot of problems.

-Andreas

On Sat, Apr 25, 2020 at 12:05 PM Don Brutzman <brutzman at nps.edu> wrote:
>
> [cc: x3d-public with permission]
>
> Andreas thank you for another helpful issue report.
>
> On 4/23/2020 7:40 PM, Andreas Plesch wrote:
> > Sorry but I keep coming across these (with 0.0.27):
>
> No really thanks, my regression testing so far only checks for exceptions, haven't done any round-trip tests which will take some nontrivial work.
>
> >>>> import x3d.x3d as x
> > x3d.py package loaded, have fun with X3D Graphics!
> >>>> x.Viewpoint(position=(1,1,1)).toXML()
> > "<Viewpoint position='(1, 1, 1)'/>\n"
> >>>>
> >
> > The output should be <Viewpoint position='1, 1, 1'/> .
>
> This is common problem/correction for all SFVec3f and similarly all numeric types and most MF types.  Will need to be extra careful (as usual) with SFString and MFString.
>
> TODO, hopefully this weekend: will be changing output to match X3D canonical form, <Viewpoint position='1, 1, 1'/>
>
> Additional error patterns also welcome.  Strict typing of X3D scene graph plus Pythonic strictness plus Quality Assurance (QA) will lead us to a really robust pipeline, suitable even for Big Data information flows.  Java has this rigor already, XML is similarly strong, when JSON Schema is finally standardized/deployed then that alternative dataflow will be ready for "prime time" application chains as well.
>
> p.s. motivation: the worst errors are those you don't know about because they fail silently.
>
> 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



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list