<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Well the stylesheet isn’t fixed yet. Here’s the diff to the stylesheet output that makes my prototype expander code work:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">diff --git a/rubikOnFire.json b/rubikOnFire.json</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">index 7242909..c8120f3 100644</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">--- a/rubikOnFire.json</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">+++ b/rubikOnFire.json</b></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(52, 187, 199);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">@@ -397,13 +397,12 @@</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> },</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "@name":"myShape",</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">- "-children":[</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(52, 189, 38);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+ "-children":</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> { "Box":</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "@size":[1,1,1]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">- ]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><br class=""></div><div class="">Submitted for your consideration. I can always had modify code (and so can everyone else???) -value doesn’t work for me, because it doesn’t pass schema. Using an object doesn’t work in schema. So I will look at that next.</div><div class=""><br class=""></div><div class="">John</div><div><blockquote type="cite" class=""><div class="">On Apr 16, 2016, at 10:42 PM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I take that back. Here’s what I’d like to do…I’d like -children to support both an object (SFNode) and an array (MFNode), so syntax like this<div class="">is acceptable:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> { "ProtoInstance":</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "@name":"twentyseven",</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "fieldValue": [</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "@name":"ttranslation",</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "@value":[0,0,0]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> },</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "@name":"myShape",</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "-children": {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "Box": {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> "@size":[1,1,1]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Thus, if you have an SFNode, it will will generate syntax like the above for -children, and if you have an MFNode, the stylesheet will generate an array for -children. And then the schema will either accept an array or an object.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Is this possible? I will test to see if the stylesheet is already fixed.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">John</span></div><div class=""><blockquote type="cite" class=""><div class="">On Apr 16, 2016, at 10:28 PM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I have verified that using -children solves my problem (at least with schema!).<br class=""><br class="">Thanks,<br class=""><br class="">John<br class=""><blockquote type="cite" class="">On Apr 3, 2016, at 12:26 PM, Don Brutzman <<a href="mailto:brutzman@nps.edu" class="">brutzman@nps.edu</a>> wrote:<br class=""><br class="">Apologies for delayed reply.<br class=""><br class="">Here is the rule that was decided as most straightforward and consistent (currently last bullet under Completed Work):<br class=""><br class=""><a href="http://www.web3d.org/x3d/stylesheets/X3dToJson.html#Issues" class="">http://www.web3d.org/x3d/stylesheets/X3dToJson.html#Issues</a><br class=""><br class="">* field and fieldValue statements containing SFNode/MFNode content use the -children key.<br class=""><br class="">Your scene passes all X3D Validator tests (good job there) and I think the relevant excerpts that you are referring to are<br class=""><br class="">=================================================================<br class="">...<br class=""><ProtoDeclare name='twentyseven'><br class=""> <ProtoInterface><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><field accessType='inputOutput' name='ttranslation' type='SFVec3f' value='0.0 0.0 0.0'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><field accessType='inputOutput' name='myShape' type='SFNode'><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> <Sphere/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></field><br class=""> </ProtoInterface><br class=""> <ProtoBody><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><Transform translation='0 0 0'><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> <IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><connect nodeField='translation' protoField='ttranslation'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> </IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> <ProtoInstance name='nine'><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><fieldValue name='ztranslation' value='0 0 0'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> <connect nodeField='myShape' protoField='myShape'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span></IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> </ProtoInstance><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> <ProtoInstance name='nine'><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><fieldValue name='ztranslation' value='0 0 2'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> <connect nodeField='myShape' protoField='myShape'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span></IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> </ProtoInstance><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> <ProtoInstance name='nine'><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><fieldValue name='ztranslation' value='0 0 -2'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> <connect nodeField='myShape' protoField='myShape'/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span></IS><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> </ProtoInstance><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></Transform><br class=""> </ProtoBody><br class=""></ProtoDeclare><br class=""><ProtoInstance name='twentyseven'><br class=""> <fieldValue name='ttranslation' value='0 0 0'/><br class=""> <fieldValue name='myShape'><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><Box size='1 1 1'/><br class=""> </fieldValue><br class=""></ProtoInstance><br class="">=================================================================<br class=""><br class="">So the corresponding conversion of the ProtoInstance to JSON would be<br class=""><br class="">{ "ProtoInstance":<br class=""> {<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>"@name":"twentyseven",<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>"fieldValue": [<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> {<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>"@name":"ttranslation",<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>"@value":[0,0,0]<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> },<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> {<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>"@name":"myShape",<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>"-children":[<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> { "Box":<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>{<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> "@size":[1,1,1]<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>}<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span> }<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>]<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span> }<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>]<br class=""> }<br class="">}<br class=""><br class="">This JSON excerpt above matches the ProtoInstance in "rubikOnFireFlawed.json" file you sent a week ago.<br class=""><br class="">Full result from X3dToJson.xslt stylesheet attached, passes jslint and also passes Roy's X3D JSON Schema validation.<br class=""><br class="">Incidentally, nested prototypes are certainly allowed by X3D Specification but the great majority of my testing to date has not been testing nesting.<br class=""><br class=""><br class="">On 3/25/2016 11:35 PM, John Carlson wrote:<br class=""><blockquote type="cite" class="">So it actually caught it after my PrototypeExpander ran on it. So there may be a bug with how my PrototypeExpander handles -children which are SFNodes (actually they are MFNodes (arrays) in the JSON code, so I think the JSON is wrong). You guys may have discussed this, or something like it, and I was ignorant at the time.<br class=""><br class="">John<br class=""><blockquote type="cite" class="">On Mar 26, 2016, at 2:28 AM, John Carlson <<a href="mailto:yottzumm@gmail.com" class="">yottzumm@gmail.com</a>> wrote:<br class=""><br class="">If you pass an SFNode to a Proto, it is treated as an MFNode and given -children, and not -value or -child. This can create -geometry nodes which are arrays instead of objects. Here are an X3D example, the converted JSON, and how the JSON should appear (hand edited). I did not pick -value or -child because I forgot what we chose. I could probably fix this another way, but i think -children is misleading when it’s an SFNode.<rubikOnFire.json><rubikOnFire.x3d><rubikOnFireFixed.json>You may use my X3D file in your X3D resources examples if you wish. rubikOnFire.json does not pass schema. If there’s a problem with my X3D file, then we should fix QA, because it passed the latest X3D-Edit tests. (Perhaps there should be a warning?). If there is a problem with my X3D file, then JSON should not be produced.<br class=""><br class="">So take your pick, fix the stylesheet, or find an error in my X3D file. Good luck with both.<br class=""><br class="">There’s likely more bugs to report. This is just the first one. Good catch Roy!<br class=""><br class="">Thanks,<br class=""><br class="">John<br class=""></blockquote></blockquote><br class="">all the best, Don<br class="">-- <br class="">Don Brutzman Naval Postgraduate School, Code USW/Br <a href="mailto:brutzman@nps.edu" class="">brutzman@nps.edu</a><br class="">Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149<br class="">X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" class="">http://faculty.nps.edu/brutzman</a><br class=""><rubikOnFire.json><br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>