<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Takeaway: Both X3dToJson.xslt and X3DJSAIL are generating "container" fields (-value) for Metadata nodes underneath Shape nodes in JSON, when they should be generating -metadata "container" fields. Specifying containerField="metadata" to the first Metadata node in a Metadata node tree in XML fixes the issue for non-top-level (under Scene) Metadata nodes in JSON. There's also an issue of generating duplicate JSON objects in X3DJSAIL or X3dToJson.xslt. I have found other issues with generated XML (possibly just comments?). If -value under Shape is OK instead of -metadata, I need to change my checking code.</div><div><br>Don, I will try reading your email one more time. Examples of Shape nodes with Metadata under them from your JSON would help. Not Text nodes, they already work.</div><div dir="ltr"><br></div><div>X_ITE and X3DOM devs and users, I also have a Metadata bug in X3DJSONLD Java generation that I am debugging. Apparently the "topLevelSceneMetadata" from HelloWorldProgramOutput.json is being ignored when converting to XML first, and then to Java. So people using my products in X3DOM and X_ITE need to be aware.</div><div dir="ltr"><br></div><div>TLDR, technical analysis data below.</div><div dir="ltr">It's highly possible that I did not have an up-to-date compiled stylesheet for X3dToJson.xslt, but I'd have to look and see where the compiled stylesheet is used. I just updated the compiled stylesheet and normal stylesheet from sourceforge, and the issue remains. I will update Saxon next. Here is a snipped of the nodes in question as appears in my HelloWorldProgramOutput.json:<div>=============================================================</div><div>HelloWorldProgramOutput.json (see -value field under Scene--that's not correct, AFAIK).<br></div><div><br></div><div><br></div><div><div> { "Shape":</div><div> {</div><div> "-value":[</div><div> { "MetadataString":</div><div> {</div><div> "@name":"findThisNameValue",</div><div> "@DEF":"FindableMetadataStringTest",</div><div> "@value":["test case"]</div><div> }</div><div> }</div><div> ],</div><div> "-appearance":</div><div> { "Appearance":</div><div> {</div><div> "@DEF":"DeclarativeAppearanceExample",</div><div> "-children":[</div><div> {</div><div> "#comment":"DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance"</div><div> }</div><div> ],</div><div> "-material":</div><div> { "ProtoInstance":</div><div> {</div><div> "@name":"MaterialModulator",</div><div> "@DEF":"MyMaterialModulator"</div><div> }</div><div> }</div><div> }</div><div> },</div><div><br></div><div>Searching JSON output from X3dtoJson.xlst and X3DJSAIL:</div><div><br></div><div><div>$ grep -e -value !$</div><div>grep -e -value HelloWorldProgramOutput.*json</div><div>HelloWorldProgramOutput.json: "-value":[</div><div>HelloWorldProgramOutput.json: "-value":[</div><div>HelloWorldProgramOutput.json: "-value":[</div><div>HelloWorldProgramOutput.json: "-value":[</div><div>HelloWorldProgramOutput.new.json: "-value":[</div><div>HelloWorldProgramOutput.new.json: "-value":[</div><div><br></div><div>The latter file could be affected by JSON to DOM conversion with X3DJSONLD.js</div><div><br></div><div>/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples" target="_blank">www.web3d.org/x3d/stylesheets/java/examples</a></div><div>$ grep -e -value HelloWorldProgramOutput.*json</div><div> "-value":[</div><div> "-value":[</div><div> "-value":[</div><div> "-value":[</div></div></div><div><br></div><div>Searching for a correct JSON file, generated by, with containerField='metadata' added looks like this:</div><div><br></div><div><div>$ grep -e -value HelloWorldProgramOutput.json</div><div> "-value":[</div><div> "-value":[</div></div><div><br></div><div>A check to see if files are up to date:</div><div><br></div><div><div>$ ls -l HelloWorldProgramOutput.*</div><div>-rw-r--r-- 1 john 197121 94303 Jul 3 00:36 HelloWorldProgramOutput.json</div><div>-rw-r--r-- 1 john 197121 48366 Jun 21 04:35 HelloWorldProgramOutput.json.new</div><div>-rw-r--r-- 1 john 197121 49202 Jul 3 00:37 HelloWorldProgramOutput.new.json</div><div>-rw-r--r-- 1 john 197121 20083 Jul 2 04:06 HelloWorldProgramOutput.new.x3d</div><div>-rw-r--r-- 1 john 197121 23263 Jul 3 00:37 HelloWorldProgramOutput.newPrettyPrint.intermediate.x3d</div><div>-rw-r--r-- 1 john 197121 23500 Jul 3 00:36 HelloWorldProgramOutput.x3d</div><div>-rw-r--r-- 1 john 197121 22571 Jul 3 00:37 HelloWorldProgramOutput.x3d.new</div></div><div><br>The below XML does not translate properly in X3dToJson.xslt (ignore the value non-container field in MetadataString, we're speaking of missing a containerField).</div><div><br></div><div><div><Shape></div><div> <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/></div><div> <Appearance DEF='DeclarativeAppearanceExample'></div><div> <!-- DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance --></div><div> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/></div><div> </Appearance></div><div> <Cone bottom='false' bottomRadius='0.05' height='0.1'/></div><div> </Shape></div></div><div><br></div><div>This is a workable example using containerField="metadata"</div><div><br></div><div><div> <Text string='"X3D Java" "SAI Library" "X3DJSAIL"'></div><div> <!-- Comment example A, plain quotation marks: He said, "Immel did it!" --></div><div> <!-- Comment example B, XML character entities: He said, "Immel did it!" --></div><div> <MetadataSet name='EscapedQuotationMarksMetadataSet' containerField='metadata'></div><div> <MetadataString name='quotesTestC' value='"MFString example C, backslash-escaped quotes: He said, \"Immel did it!\""'/></div><div> <MetadataString name='extraChildTest' value='"checks MetadataSet addValue() method"'/></div><div> </MetadataSet></div><div> <FontStyle family='"SERIF"' justify='"MIDDLE" "MIDDLE"'/></div><div> </Text></div></div><div><br></div><div>So yes, if we create XML well, X3dToJson.xslt works.</div><div><br></div><div>if we leave off the containerField='metadata' in XML, we get -value as a container field in JSON.</div><div>============================================================</div><div>There are other issues with X3dToJson.xslt, namely, duplication of nodes-- perhaps some kind of Proto expansion is being done without renaming DEFs?</div><div><br></div><div><div>$ grep Find !$</div><div>grep Find HelloWorldProgramOutput.x3d</div><div> <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/></div><div> <!-- Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/> --></div><div><br></div><div>~/X3DJSONLD/src/main/data (master)</div><div>$ grep Find HelloWorldProgramOutput.json</div><div> "@DEF":"FindableMetadataStringTest",</div><div> "#comment":"Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='\"test case\"'/>"</div><div> "@DEF":"FindableMetadataStringTest",</div><div> "#comment":"Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='\"test case\"'/>"</div></div><div>=======================Repeat from Sourceforge===================</div><div>/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples" target="_blank">www.web3d.org/x3d/stylesheets/java/examples</a><br></div><div><div>$ grep Find HelloWorldProgramOutput.x3d</div><div> <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/></div><div> <!-- Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/> --></div><div><br></div><div>/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples" target="_blank">www.web3d.org/x3d/stylesheets/java/examples</a></div><div>$ grep Find HelloWorldProgramOutput.json</div><div> "@DEF":"FindableMetadataStringTest",</div><div> "#comment":"Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='\"test case\"'/>"</div><div> "@DEF":"FindableMetadataStringTest",</div><div> "#comment":"Test success: x3dModel.findElementByNameValue(findThisNameValue) = <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='\"test case\"'/>"</div></div><div>===========================</div><div>At some point, I just add the containerField="metadata" to XML I deal with, or create my own XML to JSON conversion. Or I try to modify my own X3dToJson.xslt. Note that containerField="metadata" may not work on top level Metadata nodes (under Scene, head is ok).</div><div><br></div><div>Thanks!</div><div><br></div><div>John</div></div></div></div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 3, 2023 at 12:21 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">While JSON does not have "containerField" it does have container fields. Namely, there is a -value container field for MetadataXxx children of MetadataSet, and -metadata container field for a direct MetadataXxx descendant of a non-MetadataXxx nodes. I agree that most nodes do not contain a value field in the standard, but do contain a metadata field. In the above, replace "Xxx" to make the appropriate Metadata... type of node.<div><br></div><div>So having a Shape node with a -value container field is not legal X3D4 JSON.<br><div><div><br></div><div>I'm open to other names besides container fields, it's just confusing to have two different names for the same thing between encodings.</div><div><br></div><div>Please double check <a href="http://web3d.org" target="_blank">web3d.org</a> standards page for updating architecture document:</div><div><br></div><div><img src="cid:ii_ljmemj9n0" alt="image.png" width="420" height="117"><br></div><div><br><div><img src="cid:ii_ljmenmk31" alt="image.png" width="413" height="120"><br></div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 2, 2023 at 6:32 PM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div lang="EN-US">
<div>
<p class="MsoNormal">John, there are several issues with your mail that can be confusing. Am trying here to untangle them. You likely understand all this, but email can be tricky to follow.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Summary: here is a "deep dive" on containerField and value fields for Metadata* node examples.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="1" type="1">
<li>First, the url that you have is not current. The latest specification (International Standard proof version) url follows.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Please use the latest url, and stop using other urls.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">X3D Architecture reference:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ul style="margin-top:0in" type="disc">
<li style="margin-left:0in"><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/Architecture.html" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/Architecture.html</a><u></u><u></u></li></ul>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="2" type="1">
<li>Next, when you look at Shape node, there is no “value” field. There are fields defined for appearance, bboxDisplay, castShadow, geometry, metadata, visible, bboxCenter and bboxSize.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">X3D Architecture reference:<u></u><u></u></p>
<p style="margin-left:0.25in"><u></u> <u></u></p>
<ul style="margin-top:0in" type="disc">
<li style="margin-left:0in"><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/shape.html#Shape" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/shape.html#Shape</a><u></u><u></u></li></ul>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black">Shape : X3DShapeNode {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFNode [in,out] appearance NULL [X3DAppearanceNode]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFBool [in,out] bboxDisplay FALSE<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFBool [in,out] castShadow TRUE<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFNode [in,out] geometry NULL [X3DGeometryNode]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFBool [in,out] visible TRUE<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFVec3f [] bboxCenter 0 0 0 (-∞,∞)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFVec3f [] bboxSize -1 -1 -1 [0,∞) or −1 −1 −1<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="3" type="1">
<li>Next. Every single node in X3D includes a field named “<span style="font-size:10pt;font-family:"Courier New";color:black">metadata</span>”, where is allowed to have a single
Metadata* node (MetadataBoolean, MetadataFloat, etc.).<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">X3D Architecture reference:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ul style="margin-top:0in" type="disc">
<li style="margin-left:0in">7.3.5 X3DNode<u></u><u></u></li><li style="margin-left:0in"><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/core.html#X3DNode" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/core.html#X3DNode</a><u></u><u></u></li></ul>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black">X3DNode {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt"><span style="font-size:8.5pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">This abstract node type is the base type for all nodes and node types in the X3D system.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18.75pt">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">The <i>metadata</i> field provides information about the current node contents, as described in <a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/core.html#Metadata" target="_blank">7.2.4
Metadata</a>.<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="4" type="1">
<li>The X3D XML encoding uses containerField as a way to explicitly set the relationship of a given node to its
<b>parent</b> node.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<ul style="margin-top:0in" type="disc">
<li style="margin-left:0in">X3D Scene Authoring Hints: containerField<u></u><u></u></li><li style="margin-left:0in"><a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField</a><u></u><u></u></li></ul>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:10pt;font-family:"Times New Roman",serif;color:black">Addition of </span><span style="font-size:7pt;font-family:"Courier New";color:black">containerField</span><span style="font-size:10pt;font-family:"Times New Roman",serif;color:black"> values
only occurs in the XML encoding of .x3d scenes. For example: </span><span style="font-size:7pt;font-family:"Courier New";color:black"><Transform><Shape containerField='children'/></Transform></span><span style="font-size:10pt;font-family:"Times New Roman",serif;color:black"> indicates
that the </span><span style="font-size:7pt;font-family:"Courier New";color:black">Shape</span><span style="font-size:10pt;font-family:"Times New Roman",serif;color:black"> node is one of the </span><span style="font-size:7pt;font-family:"Courier New";color:black">children</span><span style="font-size:10pt;font-family:"Times New Roman",serif;color:black"> of
the </span><span style="font-size:7pt;font-family:"Courier New";color:black">Transform</span><span style="font-size:10pt;font-family:"Times New Roman",serif;color:black"> node.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:10pt;font-family:"Times New Roman",serif;color:black">The <a href="https://www.web3d.org/specifications/X3dSchemaDocumentation4.0/x3d-4.0.html" target="_blank">X3D XML Schema</a>, <a href="https://www.web3d.org/specifications/X3dDoctypeDocumentation4.0.html" target="_blank">X3D DTD</a> and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a> each
define all default </span><span style="font-size:7pt;font-family:"Courier New";color:black">containerField</span><span style="font-size:10pt;font-family:"Times New Roman",serif;color:black"> values, which are optional and typically can be omitted for scene
terseness.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.75in">
<u></u><span style="font-size:10pt;font-family:"Courier New";color:black"><span>o<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><b><span style="font-family:"Times New Roman",serif;color:black">Usually ignorable.</span></b><span style="font-family:"Times New Roman",serif;color:black"> Default </span><span style="font-size:8pt;font-family:"Courier New";color:black">containerField</span><span style="font-family:"Times New Roman",serif;color:black"> values
for each node are correct in most cases, so the need to override default </span><span style="font-size:8pt;font-family:"Courier New";color:black">containerField</span><span style="font-family:"Times New Roman",serif;color:black"> values is relatively rare.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.75in">
<u></u><span style="font-size:10pt;font-family:"Courier New";color:black"><span>o<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><b><span style="font-family:"Times New Roman",serif;color:black">Terse match to other X3D encodings.</span></b><span style="font-family:"Times New Roman",serif;color:black"> The </span><span style="font-size:8pt;font-family:"Courier New";color:black">containerField</span><span style="font-family:"Times New Roman",serif;color:black"> attribute
is part of XML encoding for X3D scenes, and corresponds to the always-declared field labels in the ClassicVRML and VRML97 file encodings.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.75in">
<u></u><span style="font-size:10pt;font-family:"Courier New";color:black"><span>o<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><b><span style="font-family:"Times New Roman",serif;color:black">Examples.</span></b><span style="font-family:"Times New Roman",serif;color:black"> Example values include </span><span style="font-size:8pt;font-family:"Courier New";color:black">containerField='geometry'</span><span style="font-family:"Times New Roman",serif;color:black"> for
Box node, </span><span style="font-size:8pt;font-family:"Courier New";color:black">containerField='children'</span><span style="font-family:"Times New Roman",serif;color:black"> for Group node, </span><span style="font-size:8pt;font-family:"Courier New";color:black">containerField='proxy'</span><span style="font-family:"Times New Roman",serif;color:black"> for
hidden proxy shape within a Collision node, etc.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.75in">
<u></u><span style="font-size:10pt;font-family:"Courier New";color:black"><span>o<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><b><span style="font-size:8pt;font-family:"Courier New";color:black">USE</span></b><b><span style="font-family:"Times New Roman",serif;color:black"> node flexibility.</span></b><span style="font-family:"Times New Roman",serif;color:black"> </span><span style="font-size:8pt;font-family:"Courier New";color:black">USE</span><span style="font-family:"Times New Roman",serif;color:black"> nodes
are allowed to have a containerField value that is different than the corresponding DEF declaration of that node, since the containerField attribute describes each node's relationship with its parent.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.75in">
<u></u><span style="font-size:10pt;font-family:"Courier New";color:black"><span>o<span style="font:7pt "Times New Roman"">
</span></span></span><u></u><b><span style="font-size:8pt;font-family:"Courier New";color:black">ProtoInstance</span></b><b><span style="font-family:"Times New Roman",serif;color:black"> node flexibility.</span></b><span style="font-family:"Times New Roman",serif;color:black"> </span><span style="font-size:8pt;font-family:"Courier New";color:black">ProtoInstance</span><span style="font-family:"Times New Roman",serif;color:black"> nodes
are similarly allowed to have a containerField value that is different than default for their node type, again since the containerField attribute describes each node's relationship with its parent.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-family:"Times New Roman",serif;color:black">Disambiguation of parent-child field relationships is sometimes necessary, since a few parent nodes have more than one child field that can accept the same node type. In those ambiguous cases, the
child node must have a correct </span><span style="font-size:8pt;font-family:"Courier New";color:black">containerField</span><span style="font-family:"Times New Roman",serif;color:black"> value in order to precisely define the correct parent-child field
relationship with its parent node.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Additional guidance and detail follow there, trying to explain the specification with examples. It is simply offered as helpful information. The X3D
Architecture remains the controlling normative reference.<u></u><u></u></span></p>
<ol style="margin-top:0in" start="5" type="1">
<li>Only the various Metadata* nodes have a field called “<span style="font-size:9pt;font-family:"Courier New"">value</span>”. Like every other X3D node, they also have a field called
“<span style="font-size:10pt;font-family:"Courier New";color:black">metadata</span>” too.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">X3D Architecture reference:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ul style="margin-top:0in" type="disc">
<li style="margin-left:0in">7.4 Node reference<u></u><u></u></li><li style="margin-left:0in"><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/core.html#NodeReference" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/core.html#NodeReference</a><u></u><u></u></li></ul>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-top:13.5pt;margin-left:0.25in">
<b><span style="font-family:Verdana,sans-serif;color:black">7.4.1 MetadataBoolean<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">MetadataBoolean : X3DNode, X3DMetadataObject {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] name ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] reference ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> MFBool [in,out] value []<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">The <i>value</i> field provides a list of Boolean metadata whose meaning is specified by the <i>name</i> field.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-top:13.5pt;margin-left:0.25in">
<a name="m_-6665779233930226973_m_1005165379255805813_m_2235943664552521049_m_4550798560624728884_MetadataDouble"></a><b><span style="font-family:Verdana,sans-serif;color:black">7.4.2 MetadataDouble<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">MetadataDouble : X3DNode, X3DMetadataObject {<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] name ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] reference ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> MFDouble [in,out] value []<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">The <i>value</i> field provides a list of double-precision floating-point metadata whose meaning is specified by the <i>name</i> field.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-top:13.5pt;margin-left:0.25in">
<a name="m_-6665779233930226973_m_1005165379255805813_m_2235943664552521049_m_4550798560624728884_MetadataFloat"></a><b><span style="font-family:Verdana,sans-serif;color:black">7.4.3 MetadataFloat<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">MetadataFloat : X3DNode, X3DMetadataObject {
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] name ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] reference ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> MFFloat [in,out] value []<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">The <i>value</i> field provides a list of single-precision floating-point metadata whose meaning is specified by the <i>name</i> field.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-top:13.5pt;margin-left:0.25in">
<a name="m_-6665779233930226973_m_1005165379255805813_m_2235943664552521049_m_4550798560624728884_MetadataInteger"></a><b><span style="font-family:Verdana,sans-serif;color:black">7.4.4 MetadataInteger<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">MetadataInteger : X3DNode, X3DMetadataObject {
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] name ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] reference ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> MFInt32 [in,out] value []<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">The <i>value</i> field provides a list of integer metadata whose meaning is specified by the <i>name</i> field.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-top:13.5pt;margin-left:0.25in">
<a name="m_-6665779233930226973_m_1005165379255805813_m_2235943664552521049_m_4550798560624728884_MetadataSet"></a><b><span style="font-family:Verdana,sans-serif;color:black">7.4.5 MetadataSet<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">MetadataSet : X3DNode, X3DMetadataObject {
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] name ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] reference ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> MFNode [in,out] value [] [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">The <i>value</i> field provides a list of <i>X3DMetadataObject</i> nodes whose meaning is specified by the <i>name</i> field.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-top:13.5pt;margin-left:0.25in">
<a name="m_-6665779233930226973_m_1005165379255805813_m_2235943664552521049_m_4550798560624728884_MetadataString"></a><b><span style="font-family:Verdana,sans-serif;color:black">7.4.6 MetadataString<u></u><u></u></span></b></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">MetadataString : X3DNode, X3DMetadataObject {
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFNode [in,out] metadata NULL [X3DMetadataObject]<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] name ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> SFString [in,out] reference ""<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black"> MFString [in,out] value []<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36.75pt"><span style="font-size:6pt;font-family:"Courier New";color:black">}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.25in">
<span style="font-size:9pt;font-family:Verdana,sans-serif;color:black">The <i>value</i> field provides a list of string metadata whose meaning is specified by the <i>name</i> field.<u></u><u></u></span></p>
<ol style="margin-top:0in" start="6" type="1">
<li>As shown above in the specification, only the MetadataSet node can contain Metadata* nodes in either a
<span style="font-size:10pt;font-family:"Courier New";color:black">metadata</span> field, a
<span style="font-size:9pt;font-family:"Courier New"">value</span> field, or both. So MetadataSet is the tricky node to watch out for.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Example:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> <Shape><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"><MetadataSet DEF=’TripleTroubleExample’ containerField=’metadata’><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataBoolean DEF=’SomeBooleanArray’ value=”true false true” containerField=’metadata’/><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataInteger DEF=’SomeIntegerArray’ value=’-1 -2 0 1 2 3 4’ containerField=’value’/><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataDouble DEF=’SomeDoubleArray’ value=’5.0 6.28 777.7’ containerField=’value’/><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"></MetadataSet><u></u><u></u></p>
<p class="MsoNormal"> </Shape<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Because MetadataSet can only contain one node in its <span style="font-size:10pt;font-family:"Courier New";color:black">
metadata</span> field, only one of these contained nodes can be containerField=’metadata’ and still be correct.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="7" type="1">
<li>Remember, all of this containerField business is only for terseness of the XML encoding. It has nothing to do with equivalent X3D representations in ClassicVRML, JSON, Python,
Java, Turtle, etc.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Easy to forget… Uh, did you remember that?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="8" type="1">
<li>Evolutionary trickiness is next (as if all this weren’t tricky enough already).
<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Experience in X3D3 showed that multiple metadata nodes were used, complex metadata sets became extremely verbose because containerField values were listed everywhere. In fact, they were so verbose that it became hard to read and process
the sets of metadata being collected together! Ouch.<u></u><u></u></p>
<p><u></u> <u></u></p>
<p class="MsoNormal">After much debate and experimentation, we decided to lean towards the future where there might be inclusion of quite a lot of metadata sets when converting from CAD, converting from other model formats, expressing new X3D node values, etc.
etc.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">As a result we changed the default containerField values (for Metadata* nodes only) in the X3D version 4 XML encoding. This had no impact on the vast majority of X3D scenes out there.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thus, if containerField is omitted for terseness in a given scene fragment, the XML might look different for X3D3 versus X3D4. The X3D being modeled is not different.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The above TripleTroubleExample will always be correct in every version of X3D, because the containerField field names are explicitly defined. Including containerField is never wrong.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Here are two variations on the above example that omit default containerField entries, for X3D 3.3 and X3D 4.0 respectively.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> <Shape><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"><MetadataSet DEF=’TripleTroubleExampleX3D3’ ><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataBoolean DEF=’SomeBooleanArray’ value=”true false true” /><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataInteger DEF=’SomeIntegerArray’ value=’-1 -2 0 1 2 3 4’ containerField=’value’/><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataDouble DEF=’SomeDoubleArray’ value=’5.0 6.28 777.7’ containerField=’value’/><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <!- - containerField always necessary in subsequent MetadataSet subtree values - -><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"></MetadataSet><u></u><u></u></p>
<p class="MsoNormal"> </Shape<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">or<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> <Shape><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"><MetadataSet DEF=’TripleTroubleExampleX3D4’ containerField=’metadata’><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataBoolean DEF=’SomeBooleanArray’ value=”true false true” containerField=’metadata’/><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataInteger DEF=’SomeIntegerArray’ value=’-1 -2 0 1 2 3 4’ /><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <MetadataDouble DEF=’SomeDoubleArray’ value=’5.0 6.28 777.7’ /><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"> <!- - containerField not necessary in subsequent MetadataSet subtree values - -><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in"></MetadataSet><u></u><u></u></p>
<p class="MsoNormal"> </Shape<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="9" type="1">
<li>As before, the XML terseness has nothing to do with equivalent X3D representations in ClassicVRML, JSON, Python, Java, Turtle, etc.<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Yes, it is good to remember that.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">So, any X3D JSON representations will always have the field name defined.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hopefully this explanation helps determine whether the X3dToJSON.xslt stylesheet is correct already. If not, we will fix it, just as your latest testing has identified some necessary fixes in the X3dToJava.xslt stylesheet.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Having good repeatable examples in the X3D Example Archives to test things is always helpful. Perhaps the above example snippets can help.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ol style="margin-top:0in" start="10" type="1">
<li>Your mileage may vary (YMMV).<u></u><u></u></li></ol>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Nevertheless the X3D scene graph defined by the X3D Architecture international specification is unambiguous.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">As ever, improving our XML/JSON schema validation, and diagnostic/conversion tools, and unit-test examples all helps.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Have fun with X3D – or else! 8)<u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">all the best, Don<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">-- <u></u>
<u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">Don Brutzman Naval Postgraduate School, Code USW/Br <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">X3D graphics, virtual worlds, navy robotics <a href="https://faculty.nps.edu/brutzman" target="_blank">https://faculty.nps.edu/brutzman</a><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> <br>
<b>Sent:</b> Friday, June 30, 2023 11:22 PM<br>
<b>To:</b> Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>><br>
<b>Cc:</b> X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
<b>Subject:</b> Re: Is <a href="https://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.json" target="_blank">https://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.json</a> valid?<u></u><u></u></p>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt"><u></u> <u></u></span></p>
<p class="MsoNormal">I'm not too worried about JSON schema, I just want to make sure that the X3D JSON is right, per the X3D4 standard architecture, with my own eyeballs. I may just have a misunderstanding of the following Shape standard. I don't see a value
field, just a metadata field. I realize value may be otherwise specified, but it's not in X3D tooltips either, under Shape.
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/shape.html#Shape" target="_blank">https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/shape.html#Shape</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm not seeing that Shape has a value field, but I'm not too clear on whether containerField equal to "metadata" or "value" should be used on MetadataXxx statements in Shape and Text nodes in JSON. It's highly possible that I'm totally
misunderstanding.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
I understand that both -value and @value are likely possible at some point!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Here are my diffs to the HelloWorldProgramOutput.json to make it pass:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">--- a/src/main/data/HelloWorldProgramOutput.json<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+++ b/src/main/data/HelloWorldProgramOutput.json<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">@@ -156,7 +156,7 @@<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> },<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@name":"translated",<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- "@content":"29 June 2023"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+ "@content":"30 June 2023"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> },<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@name":"generator",<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">@@ -950,15 +950,14 @@<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "-children":[<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> { "Shape":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- "-value":[<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+ "-metadata":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> { "MetadataString":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@name":"findThisNameValue",<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@DEF":"FindableMetadataStringTest",<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@value":["test case"]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> }<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- }<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- ],<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+ },<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "-appearance":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> { "Appearance":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">@@ -2206,15 +2205,14 @@<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "-children":[<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> { "Shape":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- "-value":[<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+ "-metadata":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> { "MetadataString":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@name":"findThisNameValue",<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@DEF":"FindableMetadataStringTest",<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "@value":["test case"]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> }<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- }<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- ],<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+ },<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> "-appearance":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> { "Appearance":<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> {<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Here's the diff to XML I have locally to make the JSON pass. See the blue containerField.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">diff --git a/src/main/data/HelloWorldProgramOutput.x3d b/src/main/data/HelloWorldProgramOutput.x3d<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">index 99b309451..0d47bfed3 100644<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">--- a/src/main/data/HelloWorldProgramOutput.x3d<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+++ b/src/main/data/HelloWorldProgramOutput.x3d<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">@@ -246,7 +246,7 @@ function clockTrigger (timeValue)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <!-- Test success: declarative statement createDeclarativeShapeTests() --><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <Group DEF='DeclarativeGroupExample'><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <Shape><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">- <MetadataString DEF='FindableMetadataStringTest' name='findThisNameValue' value='"test case"'/><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+ <MetadataString DEF='FindableMetadataStringTest' <span style="color:blue">
containerField='metadata' </span>name='findThisNameValue' value='"test case"'/><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <Appearance DEF='DeclarativeAppearanceExample'><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <!-- DeclarativeMaterialExample gets overridden by subsequently added MaterialModulator ProtoInstance --><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <ProtoInstance DEF='MyMaterialModulator' name='MaterialModulator' containerField='material'/><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks for a second set of eyeballs on this.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">My guess is that X3DJSAIL is not reporting a containerField when it should, to produce a processable HelloWorldProgramOutput.x3d that will produce good JSON. I do not have intermediate code right now.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">So actually, it has nothing to do with JSON and everything to do with X3DJSAIL XML output. But yeah, if you want to fix it in X3DJSAIL instead of X3dToJson.xslt, that would probably be easier, and very cool.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">John<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Sat, Jul 1, 2023 at 12:28 AM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal">Hi John. All of the JSON that you find is produced by our X3dToJson.xslt stylesheet, which hopefully meets all patterns we derived and documented at<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<ul type="disc">
<li class="MsoNormal">
X3D to JSON Stylesheet Converter<u></u><u></u></li><li class="MsoNormal">
<a href="https://www.web3d.org/x3d/stylesheets/X3dToJson.html" target="_blank">https://www.web3d.org/x3d/stylesheets/X3dToJson.html</a><u></u><u></u></li></ul>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Well-formed JSON can be checked. All of our online examples have a link to check via JSONLint, though tonight it is saying “unable to connect” (while providing plenty of advertising).<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<ul type="disc">
<li class="MsoNormal">
X3D Example Archives: X3D4WA, X3D for Web Authors, Chapter 01 Technical Overview, Hello World<u></u><u></u></li><li class="MsoNormal">
<a href="https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldIndex.html" target="_blank">https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldIndex.html</a><u></u><u></u></li><li class="MsoNormal">
upper-right inset box of links: <a href="https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.json" title="JavaScript Object Notation (JSON) encoding of X3D model" target="_blank">
<span style="font-size:13.5pt;font-family:"Times New Roman",serif">.json</span></a><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black"> (</span><a href="https://jsonlint.com/?json=https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.json" title="jsonlint validation" target="_blank"><span style="font-size:13.5pt;font-family:"Times New Roman",serif">check</span></a><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:black">)</span><u></u><u></u></li><li class="MsoNormal">
<a href="https://jsonlint.com/?json=https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.json" target="_blank">https://jsonlint.com/?json=https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.json</a><u></u><u></u></li></ul>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">If there are mistakes in our X3D .xml -> .json pattern or the conversion stylesheet, they can be fixed.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Strict JSON validation isn’t possible until a JSON Schema is approved. If you think that there is a Java-based implementation of the draft JSON Schema that is mature and stable
enough to deserve our time, we can try adding that to our various build tools for X3D Example Archives and X3DJSAIL.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<ul type="disc">
<li class="MsoNormal">
<a href="http://json-schema.org/" target="_blank">http://json-schema.org</a><u></u><u></u></li></ul>
<div>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New""> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">all the best, Don</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">--
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">Don Brutzman Naval Postgraduate School, Code USW/Br
<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:"Courier New"">X3D graphics, virtual worlds, navy robotics
<a href="https://faculty.nps.edu/brutzman" target="_blank">https://faculty.nps.edu/brutzman</a></span><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>
<br>
<b>Sent:</b> Friday, June 30, 2023 8:24 PM<br>
<b>To:</b> Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>><br>
<b>Cc:</b> X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
<b>Subject:</b> Is <a href="https://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.json" target="_blank">
https://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.json</a> valid?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Don, if<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.json" target="_blank">https://www.web3d.org/specifications/java/examples/HelloWorldProgramOutput.json</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">is supposed to be valid X3D JSON, please inform me. Thanks!
<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">To ensure that -value is not a field of Shape in JSON, I have added the following exception in x3djsonld.py.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">
<span style="color:lime"> if parent in ("Text", "Shape") and key in ("value"): # don't have value yet, sorry</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:lime"> # do value later</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:lime"> raise "-value not a supported field of Text or Shape, try -metadata?"</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:lime"> continue</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">I can revert the code if necessary. I'm trying to follow the standard as I see it.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">If -value under Shape is correct, then X3DJSAIL needs to support addValue (as I have it in Java) or setValue. That's my opinion.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">John</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div></blockquote></div>
</blockquote></div>