<html 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=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@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;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>I’m just holding up the conversation until Don provides feedback.  No need to read.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It’s a custom serializer written in Java, no DOM involved on output.  Don would know.  I’m not sure if he’s just reticent to change or there’s another requirement for roundtrip testing perhaps.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The options are stored in the ConfigurationProperties class.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It might be more flexible to write a </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>toDOM() method</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>which could be rendered into XML, XHTML, HTML, … several ways, with serializers provided by the application programmer.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I believe XSLT could transform DOM, but I haven’t done it.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>There currently isn’t any Python ElementTree anything implemented.  It is desired to generate XML from another generated python API, if you’re interested in digging into the “research” API.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Yeah, I’m not doing anything but emails right now.  I’m hopefully sitting on some golden eggs which are about to hatch.  Maybe I’m inventing something bigger than design patterns (higher level of complexity) <a href="https://en.wikipedia.org/wiki/Model_of_hierarchical_complexity#Stages_of_hierarchical_complexity">https://en.wikipedia.org/wiki/Model_of_hierarchical_complexity#Stages_of_hierarchical_complexity</a> <a href="https://en.wikipedia.org/wiki/Software_design_pattern">https://en.wikipedia.org/wiki/Software_design_pattern</a>  Christopher Alexander only covers visual aspects I think, and not non-visual aspects.  Design Patterns works on non-visual aspects.   There is also hearing and feeling and manipulating.  For example, what is the pattern behind the mouse, the keyboard, the webcam, the display etc.   Do we have senses beyond the normal 5 which can be put into a pattern?  A sense of comfort?  A sense of ease?  A sense of ease of use?  What makes an API easy to use?   What is a “good” API?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:andreasplesch@gmail.com">Andreas Plesch</a><br><b>Sent: </b>Friday, May 31, 2019 10:26 PM<br><b>To: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>Re: [x3d-public] jupyter notebook; X3DOM syntax for including X3Dwithin HTML</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>The Python core ElementTree.write method</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><a href="https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.ElementTree.write">https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.ElementTree.write</a></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>has the short_empty_elements option which allows for outputting end tags for empty elements.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I was looking for a similar option. If the underlying java XML serializer has such an option why not pass it along ?</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Andreas</p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>---on the phone---</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Fri, May 31, 2019, 8:56 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a> wrote:</p></div></div></div></div><p class=MsoNormal style='margin-left:4.8pt'>Well, if it was xhtml we were talking about you would be correct.<br><br>But, it is html without the x which is expected by the HTML renderer<br>in Jupyter. There is no XHTML renderer since the Jupyter notebook<br>itself is a HTML document.<br><br>And html allows singleton tags only for certain tags, at least in how<br>all browser parse the markup, and probably also as defined in the<br>HTML5 spec. These certain tags may include all known HTML elements<br>which do not use their text content. Unfortunately, the X3D tags are<br>considered Unknown Elements by html and they seem to require the<br>explicit end tag.<br><br>x3dom does not use any HTML parsing libraries but completely relies on<br>the web browser to do the parsing. And the browsers get confused,<br>because they do not understand the singleton x3d tags in a html<br>document.<br><br>Alas, if the xml serializing library in X3DJSAIL does not have an<br>option to generate full tags (they would be still legal XML, no?), we<br>would need to settle for xhtml IFrames which can also be included in a<br>Jupyter notebook (but not tested yet), or, as another option, wrap the<br>xml X3D into an Inline since x3dom always uses the browser XML parser<br>for Inlines. Would x3d.toStringX3DInline(filename) be considered too<br>extravagant ? It would generate an xml X3D document string with a<br>single Inline node, and also the content X3D in the file filename.<br>x3d.toFileX3DInline(x3dFileName, inlineFileName) would generate two<br>files.<br><br>Perhaps Python has an option to serialize out the full tags, perhaps<br>as HTMLFragments. Then a x3d.toStringFullTags() could be included<br>outside of X3DJSAIL, and with X3DPSAIL.<br><br>To consider X_ITE and x3dom together it would be first necessary get<br>X_ITE to work at all with Jupyter locally generated content. It may be<br>possible since X_ITE works with remote URLs in Jupyter.<br><br>-Andreas<br><br>---on the phone---<br><br>On Fri, May 31, 2019, 5:14 PM <<a href="mailto:x3d-public-request@web3d.org" target="_blank">x3d-public-request@web3d.org</a> wrote:<br>><br>> Send x3d-public mailing list submissions to<br>>         <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>><br>> To subscribe or unsubscribe via the World Wide Web, visit<br>>         <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>> or, via email, send a message with subject or body 'help' to<br>>         <a href="mailto:x3d-public-request@web3d.org" target="_blank">x3d-public-request@web3d.org</a><br>><br>> You can reach the person managing the list at<br>>         <a href="mailto:x3d-public-owner@web3d.org" target="_blank">x3d-public-owner@web3d.org</a><br>><br>> When replying, please edit your Subject line so it is more specific<br>> than "Re: Contents of x3d-public digest..."<br>><br>><br>> Today's Topics:<br>><br>>    1. Re: jupyter notebook; X3DOM syntax for including X3D within<br>>       HTML/XHTML (Brutzman, Donald (Don) (CIV))<br>><br>><br>> ----------------------------------------------------------------------<br>><br>> Message: 1<br>> Date: Fri, 31 May 2019 10:14:05 +0000<br>> From: "Brutzman, Donald (Don) (CIV)" <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>><br>> To: "<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>" <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>> Subject: Re: [x3d-public] jupyter notebook; X3DOM syntax for including<br>>         X3D within HTML/XHTML<br>> Message-ID: <<a href="mailto:b6c49fa9-6afc-34fe-ee57-59f0ad5fc99d@nps.edu" target="_blank">b6c49fa9-6afc-34fe-ee57-59f0ad5fc99d@nps.edu</a>><br>> Content-Type: text/plain; charset="utf-8"<br>><br>> thanks for great progress.<br>><br>> On 5/28/2019 12:12 PM, Andreas Plesch wrote:<br>> > - x3dom has a problem with generated X3D outside of an Inline because<br>> > the serialized XML output uses self-closing tags such as <Material /><br>> > which is not HTML compatible.<br>><br>> HTML allows singleton elements, i.e. self-closing tags.<br>><br>> Similarly, element CamelCaseElementNames are legal, so we should not have to rename <Material/> to <material></material> simply because of similarity to another language's naming patterns.<br>><br>> i think root of this problem likely lies in how X3DOM uses the accompanying DOM libraries - not sure of those details.<br>><br>> Note that I got *all* of the X_ITE and X3DOM examples to work with HTML by assigning scenes to .html and .xhtml respectively.<br>><br>> <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples" target="_blank">http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples</a><br>><br>> <a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldIndex.html" target="_blank">http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldIndex.html</a><br>> <a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldX3dom.xhtml" target="_blank">http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldX3dom.xhtml</a><br>> <a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldX_ITE.html" target="_blank">http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldX_ITE.html</a><br>><br>> > So the suggestion would be to provide a method, say<br>> > x3d.toStringX3DClosingTags(), which generates explicit closing tags:<br>> > <Material></Material><br>><br>> I don't think it is good to propagate a side-effect fix (which encourages mysterious improper practices and hides path towards fixes).<br>><br>> Rather it is more desirable to isolate and fix the actual problem.  If someone can figure out why X3DOM runs differently when included within .xhtml and .html pages, that may reveal whatever idiosyncrasy is actually occurring.<br>><br>> Finally we want to match the same patterns in X_ITE and X3DOM so that choice of player is independent of source-model syntax when using X3D version 4.  So this is a worthy mismatch to figure out and fix.  Hopefully we can get closer to sorting things out fully.<br>><br>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br>><br>> Meanwhile: found and fixed several errors in online X3DOM .xhtml examples:<br>> - corrected url to match changed release address:<br>>    <a href="https://x3dom.org/release/x3dom.css" target="_blank">https://x3dom.org/release/x3dom.css</a><br>>    <a href="https://x3dom.org/release/x3dom-full.js" target="_blank">https://x3dom.org/release/x3dom-full.js</a><br>><br>> - fixed bug in X3dToX3dom.xslt code logic in order to include function toggleFullscreen ()<br>><br>> - using XHTML Transitional (vice Strict) DTD in order for anchor target attribute to pass validation<br>>    <a href="https://stackoverflow.com/questions/4666523/xhtml-strict-1-0-target-blank-not-valid" target="_blank">https://stackoverflow.com/questions/4666523/xhtml-strict-1-0-target-blank-not-valid</a><br>><br>> X3dToX3dom.xslt stylesheet correction checked in, X3DOM example pages updated and uploaded.  Having fun with X3DOM!  8)<br>><br>> all the best, Don<br>> --<br>> Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<br>> X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" target="_blank">http://faculty.nps.edu/brutzman</a><br>><br>> ------------------------------<br>><br>> Subject: Digest Footer<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" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>><br>><br>> ------------------------------<br>><br>> End of x3d-public Digest, Vol 122, Issue 137<br>> ********************************************</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>