<div dir="auto">Don, as far as I know, the issue is with constructing the ProtoDeclare scenegraph.   I don’t see how I can generate XML, VRML or JSON if construction doesn’t work.</div><div dir="auto"><br></div><div dir="auto">I fully realize that ECMAScript Protos take a different approach.   I’m wondering what will be standardized, or will both approaches be acceptable?   If there’s an XML or VRML *parser* let’s use it!</div><div dir="auto"><br></div><div dir="auto">Thumbs up!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 21, 2021 at 11:57 PM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Hi John, am trying to follow your message.<br>
<br>
We have pylint but recent upgrade to python caused a gap, not resolved yet.<br>
<br>
Meanwhile python evaluates everything building the scene graph quite strictly, primarily through setters when creating values.  I'm not sure it is possible to create invalid XML, VRML or JSON from x3d.py package.  If such a case is found, let's fix the bug it indicates.<br>
<br>
If you have an example python program/snippet that does _not_ produce valid XML, VRML or JSON, please advise.<br>
<br>
v/r Don<br>
<br>
<br>
-----Original Message-----<br>
From: x3d-public <<a href="mailto:x3d-public-bounces@web3d.org" target="_blank">x3d-public-bounces@web3d.org</a>> On Behalf Of John Carlson<br>
Sent: Saturday, August 21, 2021 3:10 AM<br>
To: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
Subject: [x3d-public] Next, in Python news...<br>
<br>
I've been converting JSON schema to pure python validators (no separate JSON schema file required) with a python package (not mine).  If I could convert X3DUOM to Python and get a free XML, VRML, and JSON schema validation in Python, that would WOW me. BTW, I see that you don't use an XML parser in Python yet?  May I recommend the popular ElementTree built-in package.  Here's a simple pattern (in python):<br>
<br>
import xml.etree.ElementTree<br>
soup =<br>
xml.etree.ElementTree.parse(open("../../specifications/X3dUnifiedObjectModel-4.0.xml")).getroot()<br>
<br>
So, Don should look at pylint output in the logs, perhaps? Me too!  I just found out about pylint!  I can find bugs in Python while Don works on Python-creating XSLT?   That would seem a better division of labor. I just ran ```ant pylint```.  I can do that and search for bugs in x3d.py.  I see that my changes are 1.53/10 worse, so I'm backing the changes that I made to X3duomToX3dPythonPackage.xslt. Please revisit this email, or look at code I pasted below.  The problem is around isinstance.  I could be misunderstanding duck typing.  To me, 2 ProtoBody's inside the isinstance parameters spells trouble, but I'm unsure of a fix at this point.  I have a backup of my changes should we need to recover.  Perhaps a step forward is better than a step backwards?<br>
<br>
     @ProtoBody.setter<br>
     def ProtoBody(self, ProtoBody):<br>
         if  ProtoBody is None:<br>
             ProtoBody = None # default<br>
         assertValidSFNode(ProtoBody)<br>
         if not ProtoBody is None and not<br>
isinstance(ProtoBody,(ProtoBody,ProtoInstance)):<br>
             # print(flush=True)<br>
             raise X3DTypeError(str(ProtoBody) + ' does not match required node type (ProtoBody,ProtoInstance) and is invalid')<br>
         self.__ProtoBody = ProtoBody<br>
<br>
<br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>