<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle20
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:97218206;
mso-list-type:hybrid;
mso-list-template-ids:-2007190442 -1110657124 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:2;
mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Thanks for issue report. Am first wondering, despite error message, was your XML produced satisfactorily?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Next, troubleshooting.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>“<b><span style='font-size:10.0pt;font-family:"Courier New"'>*** Python-to-XML well-formed XML document test failed</span></b><b>.</b>” means that the Python XML library failed to validate the XML output.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The error message shows exactly what it dislikes: having a hash tag # in the xmldsig namespace, which in XML parlance refers to a namespace.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> XMLSchemaParseError cannot import namespace '<a href="https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23&data=05%7C01%7Cbrutzman%40nps.edu%7C62e4f8b58b7448e6e1b108db85dd8561%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638250958735907841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=9BQStQVSdrx59SRA0ALPIYLsm61LK12bt%2BhABuwHgPw%3D&reserved=0">http://www.w3.org/2000/09/xmldsig#</a>': Entities are forbidden (entity_name='dsig')<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The construct itself is OK, and used in XML documents with a digital signature, as specified by<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>XML Signature Syntax and Processing Version 2.0<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>W3C Working Group Note 23 July 2015<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>http://www.w3.org/TR/xmldsig-core2<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>XML Signature Best Practices, W3C Working Group Note 11 April 2013<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://www.w3.org/TR/xmldsig-bestpractices<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The second reference on best practices suggests a workaround of sorts (manually coerce until it avoids an error).<o:p></o:p></p><ul type=disc><li class=MsoListParagraph style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:0in;mso-list:l0 level1 lfo1'><span style='font-size:13.5pt'>3.4 For Applications: Signing XML without namespace information ("legacy XML") <o:p></o:p></span></li><li class=MsoListParagraph style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:0in;mso-list:l0 level1 lfo1'>Best Practice 21: Applications: When creating an enveloping signature over XML without namespace information, take steps to avoid having that content inherit the XML Signature namespace.<o:p></o:p></li><li class=MsoListParagraph style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:0in;mso-list:l0 level1 lfo1'>Avoid enveloped content from inheriting the XML Signature namespace by either inserting an empty default namespace declaration or by defining a namespace prefix for the Signature Namespace usage. <o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://www.w3.org/TR/2013/NOTE-xmldsig-bestpractices-20130411/#signing-xml-without-namespaces<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The current code producing this warning in our x3d.py library is on line 15186. The preceding lines of code use python’s xmlschema package and then xml.etree XML()<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Root-cause analysis: this appears to be a failure in the xmlschema Python library. We will need to track down how to report an issue there… here goes….<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://pypi.org/project/xmlschema<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://xmlschema.readthedocs.io/en/latest<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://xmlschema.readthedocs.io/en/latest/api.html#xmlschema.XMLSchemaNamespaceError<o:p></o:p></li><ul style='margin-top:0in' type=circle><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level2 lfo1'><i>exception </i>XMLSchemaNamespaceError<o:p></o:p></li><li class=MsoListParagraph style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:0in;mso-list:l0 level2 lfo1'>Raised when a wrong runtime condition is found with a namespace.<o:p></o:p></li></ul><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>xmlschema project page<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://github.com/sissaschool/xmlschema<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Bug report submitted:<o:p></o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>xmlschema issues<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>validation problem, xmldsig# namespace for XML digital signature #357<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://github.com/sissaschool/xmlschema/issues/357<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve added a TODO item in the x3d.py code generator to help us track this down at some future point. Code block follows for full clarity and future reference.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> try:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> selfX3dXmlText = ''<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> import xmlschema<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> x3dSchemaUrl = 'https://www.web3d.org/specifications/x3d-' + validationVersion + '.xsd'<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> x3dschema = xmlschema.XMLSchema(x3dSchemaUrl)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> try:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> from xml.etree import ElementTree<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> selfX3dXmlText = self.XML()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> selfX3dXmlTree = ElementTree.fromstring(selfX3dXmlText)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print("Python-to-XML well-formed XML document test of XML output complete")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> x3dschema.is_valid(selfX3dXmlTree)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print("Python-to-XML X3D", str(self.version), "schema validation test of XML output complete")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> except SyntaxError as err: # Exception<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> # https://stackoverflow.com/questions/18176602/how-to-get-the-name-of-an-exception-that-was-caught-in-python<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print("*** Python-to-XML X3D", str(self.version), "schema validation test of XML output failed.")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print(" x3dSchemaUrl=", x3dSchemaUrl)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> if hasattr(err,'position') and err.position[0]:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print(" ", type(err).__name__, "(line=" + str(err.lineno) + ')', err)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> if selfX3dXmlText: # might have failed to generate<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print(prependLineNumbers(selfX3dXmlText,err.lineno))<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> except Exception as err: # usually ParseError<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> # https://docs.python.org/3/library/xml.etree.elementtree.html#exceptions<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print("*** Python-to-XML well-formed XML document test failed.")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print(" x3dSchemaUrl=" + x3dSchemaUrl)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print(" " + type(err).__name__, err)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> if hasattr(err,'position') and err.position[0]:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> lineNumber = err.position[0]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print('type(err.position)=' + str(type(err.position)), 'lineNumber=' + str(lineNumber))<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> else:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> lineNumber = 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> if selfX3dXmlText: # might have failed to generate<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> print(prependLineNumbers(selfX3dXmlText,lineNumber))<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'> <b># TODO handle xmldsig# namespace error by xmlschema library - otherwise trap/identify this error<o:p></o:p></b></span></p><p class=MsoNormal><b><span style='font-size:8.0pt;font-family:"Courier New"'> # Submitted bug report: validation problem, xmldsig# namespace for XML digital signature #357<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:8.0pt;font-family:"Courier New"'> # https://github.com/sissaschool/xmlschema/issues/357<o:p></o:p></span></b></p><div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt'>Again thanks for helpful issue report. Have fun with X3D Python!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>all the best, Don<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>-- <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>Don Brutzman Naval Postgraduate School, Code USW/Br brutzman@nps.edu<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>X3D graphics, virtual worlds, navy robotics https://faculty.nps.edu/brutzman<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> John Carlson <yottzumm@gmail.com> <br><b>Sent:</b> Sunday, July 16, 2023 2:18 AM<br><b>To:</b> Brutzman, Donald (Don) (CIV) <brutzman@nps.edu>; X3D Graphics public mailing list <x3d-public@web3d.org><br><b>Subject:</b> Not sure what to do with this failure?<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><div><p class=MsoNormal>Text-python attached, see below weird issue. Should I upgrade? What is happening with x3d.py and X3D 4.0? The link is good, but it looks like the schema doesn't validate?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Back to JSON.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>py JinLOA4Canonical101.py.txt<o:p></o:p></p></div><div><p class=MsoNormal>x3d.py package 4.0.64.4 loaded, have fun with X3D Graphics!<o:p></o:p></p></div><div><p class=MsoNormal>Self-test diagnostics:<o:p></o:p></p></div><div><p class=MsoNormal>*** Python-to-XML well-formed XML document test failed.<o:p></o:p></p></div><div><p class=MsoNormal> x3dSchemaUrl=https://www.web3d.org/specifications/x3d-4.0.xsd<o:p></o:p></p></div><div><p class=MsoNormal> XMLSchemaParseError cannot import namespace 'http://www.w3.org/2000/09/xmldsig#': Entities are forbidden (entity_name='dsig')<o:p></o:p></p></div><div><p class=MsoNormal>Python-to-VRML export of VRML output successful<o:p></o:p></p></div><div><p class=MsoNormal>Python-to-JSON export of JSON output successful (under development)<o:p></o:p></p></div><div><p class=MsoNormal>python load and self-test diagnostics complete.<o:p></o:p></p></div></div></div></div></div></body></html>