<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;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",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:12.0pt;
font-family:"Aptos",sans-serif;}
span.EmailStyle21
{mso-style-type:personal-compose;
font-family:"Aptos",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:935480889;
mso-list-type:hybrid;
mso-list-template-ids:2142251048 78126534 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
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:Aptos;
mso-bidi-font-family:"Times New Roman";}
@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;}
@list l1
{mso-list-id:1393886541;
mso-list-type:hybrid;
mso-list-template-ids:-1037954772 -514682180 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Aptos",sans-serif;
mso-fareast-font-family:Aptos;
mso-bidi-font-family:"Times New Roman";}
@list l1: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 l1: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 l1: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 l1: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 l1: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 l1: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 l1: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 l1: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><span style='font-size:11.0pt'>[cc: x3d-public]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>John, the question is answered in your message. You can’t add comments to a USE node.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>This design choice is intentional to maximize interoperability across programming languages and file encodings. If you are wondering why:<o:p></o:p></span></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l1 level1 lfo1'><span style='font-size:11.0pt'>There is no requirement for a USE node to include a comment.<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l1 level1 lfo1'><span style='font-size:11.0pt'>USE nodes have no way of including a comment in VRML file encodings, though an XML element with a USE attribute can contain a comment in XML encoding.<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l1 level1 lfo1'><span style='font-size:11.0pt'>USE nodes might follow a comment, or be followed by a comment, and so authors are not impeded.<o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l1 level1 lfo1'><span style='font-size:11.0pt'>If X3DJSAIL were to allow comments with USE nodes, there would be no consistent way to perform round-trip conversions.<o:p></o:p></span></li></ul><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>Authoring suggestion: if you want to be descriptive about the purpose of a USE node, then be descriptive when creating the DEF/USE label. Creating good names is a good authoring practice, for many reasons. Example:<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo2'><span style='font-size:9.0pt;font-family:"Courier New"'><Material DEF=’MyMagnificentPurpleMaterial’ diffuseColor='1 0 1'/><o:p></o:p></span></li></ul><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo2'><span style='font-size:9.0pt;font-family:"Courier New"'><Material USE=’MyMagnificentPurpleMaterial’/><o:p></o:p></span></li></ul><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:11.0pt'>When a converter encounters an XML .x3d file that has an embedded comment within a USE node, and the converter is not stripping comments, best practice for conversion is to let the comment follow the USE node. For example:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo2'><span style='font-size:9.0pt;font-family:"Courier New"'><Material DEF=’MyMagnificentPurpleMaterial’ diffuseColor='1 0 1'><o:p></o:p></span></li></ul><p class=MsoListParagraph style='margin-left:1.0in'><span style='font-size:9.0pt;font-family:"Courier New"'><!-- A descriptive comment --><o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-size:9.0pt;font-family:"Courier New"'></Material><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:11.0pt'>becomes<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><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo2'><span style='font-size:9.0pt'>ClassicVRML, VRML:</span><span style='font-size:9.0pt;font-family:"Courier New"'> <o:p></o:p></span></li></ul><p class=MsoListParagraph><span style='font-size:9.0pt;font-family:"Courier New"'>material USE MyMagnificentPurpleMaterial<o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-size:9.0pt;font-family:"Courier New"'># A descriptive comment<o:p></o:p></span></p><p class=MsoListParagraph><span style='font-size:9.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo2'><span style='font-size:9.0pt'>XML:</span><span style='font-size:9.0pt;font-family:"Courier New"'> <o:p></o:p></span></li></ul><p class=MsoListParagraph><span style='font-size:9.0pt;font-family:"Courier New"'><Material DEF=’MyMagnificentPurpleMaterial’ diffuseColor='1 0 1'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-size:9.0pt;font-family:"Courier New"'><!-- A descriptive comment --><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:11.0pt'>In Java, your exception example <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"'> .addChild(new Transform().setScale(.2,.2,.2)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'> .addChild(new Shape().setUSE("Torus")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'> .addComments(" Knot "))<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:11.0pt'>is better expressed as<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"'> .addChild(new Transform().setScale(.2,.2,.2)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'> .addChild(new Shape().setUSE("Torus")<b>)</b><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'> .addComments(" Knot ")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>p.s. relevant “Doctor Doctor” joke:<o:p></o:p></span></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 lfo2'>A guy sees his doctor out in town one day and says, "Doctor, my arm really hurts when I bend it this way (he bends it), do you have any advice?" <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 lfo2'>The doctor says “don't bend it that way.“<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 lfo2'>https://allnurses.com/old-joke-arm-pain-t731263<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo2'><span style='font-size:11.0pt'>Addendum for U.S. patients without health insurance: “That will be $800 please.” <o:p></o:p></span></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo2'><span style='font-size:11.0pt'>Ow :0<o:p></o:p></span></li></ul><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><span style='font-size:11.0pt'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> John Carlson <yottzumm@gmail.com> <br><b>Sent:</b> Sunday, February 18, 2024 1:50 PM<br><b>To:</b> Brutzman, Donald (Don) (CIV) <brutzman@nps.edu>; Joe D Williams <joedwil@earthlink.net><br><b>Subject:</b> Issue with X3dToJava.xslt. Can't addComments to setUSE<o:p></o:p></span></p></div></div><div><div><div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal>Java and original X3D attached. I will look for a new version in the archives.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I'm not sure how to patch my serializer, so I'm looking for some insight.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>It appears that X3DJSAIL says that comments can't be applied to a USE node.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>$ java -Xss1g -Xmx4g -cp .;C:/Users/john/pythonSAI/saxon-he-12.1.jar;C:/Users/john/pythonSAI/X3DJSAIL.4.0.full.jar net/x3djsonld/data/Trebuchet<o:p></o:p></p></div><div><p class=MsoNormal>Build this X3D model, showing validation diagnostics...<o:p></o:p></p></div><div><p class=MsoNormal>*** Further hints on X3DJSAIL errors and exceptions at<o:p></o:p></p></div><div><p class=MsoNormal>*** <a href="https://www.web3d.org/specifications/java/X3DJSAIL.html">https://www.web3d.org/specifications/java/X3DJSAIL.html</a><o:p></o:p></p></div><div><p class=MsoNormal>Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: addComments(" Knot ")<o:p></o:p></p></div><div><p class=MsoNormal>cannot be applied to a USE node (USE='Torus') which only contains a reference to a DEF node<o:p></o:p></p></div><div><p class=MsoNormal> at org.web3d.x3d.jsail.Shape.Shape.addComments(Shape.java:1346)<o:p></o:p></p></div><div><p class=MsoNormal> at net.x3djsonld.data.Trebuchet.initialize(Trebuchet.java:292)<o:p></o:p></p></div><div><p class=MsoNormal> at net.x3djsonld.data.Trebuchet.<init>(Trebuchet.java:113)<o:p></o:p></p></div><div><p class=MsoNormal> at net.x3djsonld.data.Trebuchet.main(Trebuchet.java:643)<o:p></o:p></p></div></div></div></div></div></body></html>