<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=utf-8"><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:591200706;
mso-list-type:hybrid;
mso-list-template-ids:1656498432 681866552 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:16;
mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;
mso-fareast-font-family:Calibri;
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:;
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:;
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:;
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:;
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:;
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>Hi John. Trying to understand. I think you are saying that your .json output has unexpected newline characters.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am not finding unexpected newlines in any of the following versions of that file:<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'>Published version at <o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>Version control at <o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>Locally built copy (attached)<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The X3dToJson.xslt stylesheet source includes a warning about this:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <!-- saxon9he problem: fails due to line length, licensing issue: saxon:line-length="10000" --><o:p></o:p></p><p class=MsoNormal> <!-- https://stackoverflow.com/questions/23084785/xslt-avoid-new-line-added-between-element-attributes/43301327#43301327 --><o:p></o:p></p><p class=MsoNormal> <xsl:output method="text" encoding="UTF-8"/> <!-- output methods: xml html text --><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Which further refers to<o:p></o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>Saxon documentation, Serialization parameters<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo1'>https://www.saxonica.com/documentation12/index.html#!extensions/output-extras/serialization-parameters<o:p></o:p></li></ul><p class=MsoNormal><o:p> </o:p></p><table class=MsoNormalTable border=0 cellspacing=5 cellpadding=0 width=1096 style='width:822.35pt;margin-left:33.75pt'><tr><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Courier New"'>saxon:line-length</span><o:p></o:p></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><i><span style='font-size:10.0pt;font-family:"Courier New"'>integer</span></i><o:p></o:p></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Default value 80. With the XML output method, attributes are output on a new line if they would otherwise extend beyond this column position. With the HTML output method, text lines are split at this line length when possible.<o:p></o:p></p></td></tr><tr><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Courier New"'>saxon:newline</span><o:p></o:p></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><i><span style='font-size:10.0pt;font-family:"Courier New"'>string</span></i><o:p></o:p></p></td><td style='padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Default value 10. Defines the string that is used by the text output method to represent a newline. The Windows line ending x0Dx0A (CRLF) may sometimes be preferred to the default of a single newline character, this can be specified using <span style='font-size:10.0pt;font-family:"Courier New"'>saxon:newline="
"</span>.<o:p></o:p></p></td></tr></table><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As inspection of stylesheet directory shows, I’m not using either these parameters. Current committed build is saxon-he-12.1.jar<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Recommend that you look at your saxon version and invocation.<o:p></o:p></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;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> Monday, July 3, 2023 8:31 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> Re: JSON encoding long line split in HelloWorldProgramOutput.java<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><div><div><div><p class=MsoNormal>I'm working on temporarily patching HelloWorldProgramOutput.json to make it so I can create Java from it. I know how to patch the java (Don, see below enclosed--previous message). I am now trying to repair the JSON I use to create it. Note that the Java I produce does not have two sets of @value diffs, probably because the JSON parser:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>import javax.json.JsonObject;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>dropped one with the same property name, as previously discussed. I suggest passing your JSON through jsonlint and diff, as this command does:<o:p></o:p></p></div><div><p class=MsoNormal>$ jsonlint C:/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json">www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json</a> | diff - ../../../data/HelloWorldProgramOutput.json<o:p></o:p></p></div><div><p class=MsoNormal>[snipped output, if you want evidence, mail me privately]<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>diff ../../../data/HelloWorldProgramOutput.json /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json">www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json</a><o:p></o:p></p></div><div><p class=MsoNormal>103c103<o:p></o:p></p></div><div><p class=MsoNormal>< "@content":"1 July 2023"<o:p></o:p></p></div><div><p class=MsoNormal>---<o:p></o:p></p></div><div><p class=MsoNormal>> "@content":"3 July 2023"<o:p></o:p></p></div><div><p class=MsoNormal>226c226<o:p></o:p></p></div><div><p class=MsoNormal>< "@value":["Top-level root Metadata node beneath Scene needs to be one of '-children' in ..."]<o:p></o:p></p></div><div><p class=MsoNormal>---<o:p></o:p></p></div><div><p class=MsoNormal>> "@value":["Top-level root Metadata node beneath Scene needs to be one of '-children' in JSON encoding"]<o:p></o:p></p></div><div><p class=MsoNormal>1482c1482<o:p></o:p></p></div><div><p class=MsoNormal>< "@value":["Top-level root Metadata node beneath Scene needs to be one of '-children' in ..."]<o:p></o:p></p></div><div><p class=MsoNormal>---<o:p></o:p></p></div><div><p class=MsoNormal>> "@value":["Top-level root Metadata node beneath Scene needs to be one of '-children' in JSON encoding"]<o:p></o:p></p></div><div><p class=MsoNormal>2691c2691<o:p></o:p></p></div><div><p class=MsoNormal>< }<o:p></o:p></p></div><div><p class=MsoNormal>---<o:p></o:p></p></div><div><p class=MsoNormal>> }<o:p></o:p></p></div><div><p class=MsoNormal>\ No newline at end of file<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div></div></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Mon, Jul 3, 2023 at 9:29 AM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><div><div><div><p class=MsoNormal>There's no HelloHelloWorldProgramOutput.java in the java/examples folder?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I see the problem with the MetataString setValue method call:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>---Original<o:p></o:p></p></div><div><div><p class=MsoNormal>203,204c203<o:p></o:p></p></div><div><p class=MsoNormal>< .addMetadata(new MetadataString("scene.addChildMetadata").setName("test").setValue(new String[] {"Top-level root Metadata node beneath Scene needs to be one of '-children' in JSON<o:p></o:p></p></div><div><p class=MsoNormal>< encoding"}))<o:p></o:p></p></div><div><p class=MsoNormal>---Fixed<o:p></o:p></p></div><div><p class=MsoNormal>> .addMetadata(new MetadataString("scene.addChildMetadata").setName("test").setValue(new String[] {"Top-level root Metadata node beneath Scene needs to be one of '-children' in JSON encoding"}))<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Unquoted newlines are not allowed in Java. Search for the JSON at the end of the line, then join the two lines. Corrected source code is attached.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I'm not sure why Saxon??? is chopping the line in two. I will research other versions of Saxon. Maybe there was a change to X3dToJava.xslt><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks!<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>John<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>c:/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples" target="_blank">www.web3d.org/x3d/stylesheets/java/examples</a><o:p></o:p></p></div><div><p class=MsoNormal>$ ls -ltr *class *java<o:p></o:p></p></div><div><p class=MsoNormal>-rw-r--r-- 1 john 197121 285815 Jul 2 01:49 CleatClamp.class<o:p></o:p></p></div><div><p class=MsoNormal>-rw-r--r-- 1 john 197121 195539 Jul 2 01:49 CleatClamp.java<o:p></o:p></p></div><div><p class=MsoNormal>-rw-r--r-- 1 john 197121 114112 Jul 2 01:49 HelloWorldProgram.java<o:p></o:p></p></div><div><p class=MsoNormal>-rw-r--r-- 1 john 197121 36474 Jul 2 01:49 HelloWorldProgramOutput.class<o:p></o:p></p></div><div><p class=MsoNormal>-rw-r--r-- 1 john 197121 11911 Jul 2 01:49 flowers4.class<o:p></o:p></p></div><div><p class=MsoNormal>-rw-r--r-- 1 john 197121 69291 Jul 3 05:17 HelloWorldProgram.class<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>c:/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples" target="_blank">www.web3d.org/x3d/stylesheets/java/examples</a><o:p></o:p></p></div><div><p class=MsoNormal>$ svn up .<o:p></o:p></p></div><div><p class=MsoNormal>Updating '.':<o:p></o:p></p></div><div><p class=MsoNormal>At revision 35199.<o:p></o:p></p></div></div></div></div></div></blockquote></div></div></div></div></body></html>