<div dir="auto">Oh, good, this popped up my radar again.</div><div dir="auto"><br></div><div dir="auto">I believe the solution to this involves setting line lengths in Saxon.   I might look into configuration properties or various ways X3DJSAIL configures Saxon.</div><div dir="auto"><br></div><div dir="auto">Thanks for any additional bug reporting/fixing you might have.</div><div dir="auto"><br></div><div dir="auto">This is pretty much the only thing that’s popped into my mind.</div><div dir="auto"><br></div><div dir="auto">I need to do more JSON round tripping.</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 3, 2021 at 3:09 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">X3D JSON, as generated from X3DJSAIL (X3dToJson.xslt?) does not parse.<br>
<br>
Attaching examples/Json.json as exported from <br>
/c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/src/net/coderextreme/JsonConversion.java" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/src/net/coderextreme/JsonConversion.java</a><br>
<br>
Suggestion:  use jsonlint to dignose newline or carriage-return in <br>
@content value<br>
<br>
$ jsonlint examples/Json.json > HWPPP.json<br>
Error: Parse error on line 85:<br>
...iption","@content":"Example HelloWorldP<br>
----------------------^<br>
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got <br>
'undefined'<br>
     at Object.parseError <br>
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:55:11)<br>
     at Object.parse <br>
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:132:22)<br>
     at parse (/usr/local/lib/node_modules/jsonlint/lib/cli.js:82:14)<br>
     at main (/usr/local/lib/node_modules/jsonlint/lib/cli.js:135:14)<br>
     at Object.<anonymous> <br>
(/usr/local/lib/node_modules/jsonlint/lib/cli.js:179:1)<br>
     at Module._compile (internal/modules/cjs/loader.js:1138:30)<br>
     at Object.Module._extensions..js <br>
(internal/modules/cjs/loader.js:1158:10)<br>
     at Module.load (internal/modules/cjs/loader.js:986:32)<br>
     at Function.Module._load (internal/modules/cjs/loader.js:879:14)<br>
     at Function.executeUserEntryPoint [as runMain] <br>
(internal/modules/run_main.js:71:12)<br>
<br>
I am pretty much clueless at this point.  I think things point to <br>
X3dToJson.xslt, but I'm unsure how the newline/carriage-return got <br>
introduced.<br>
<br>
Another possible clue is here:<br>
<br>
HelloWorldProgramOutputX3dom.xhtml:         <meta content='Example <br>
HelloWorldProgram creates an X3D model using the X3D Java Scene<br>
<br>
Perhaps some kind of copy/pasting going on?<br>
<br>
I recently upgraded, so I'm going to rebuild X3DJSAIL.  I didn't see <br>
much in the diff, but maybe, just maybe.<br>
<br>
John<br>
<br>
On 4/3/21 2:39 PM, John Carlson wrote:<br>
> I will start looking at X3DLoaderDOM.java for possible issues.<br>
><br>
> John<br>
><br>
> On 4/3/21 2:37 PM, John Carlson wrote:<br>
>> I know I am not presenting as well as I can. In summary, <br>
>> X3DJSONLD.java should look at containerFields and defaults (perhaps), <br>
>> and X3DLoaderDOM.java should look at DISEntityTypeMapping (children <br>
>> of DISEntityManager) and children of LoadSensor.  This will be a good <br>
>> start at finishing off X3DJSONLD extensions to X3DJSAIL, and likely <br>
>> enhance DOM document loading in X3DJSAIL.<br>
>><br>
>> ==============================<br>
>><br>
>> I found an XML pretty printer.<br>
>><br>
>> The main differences between JsonConversion.java [ XML DOM output] <br>
>> (HWP.x3d, previously posted) and HelloWorldProgramOutput.x3d appear <br>
>> to be containerFields and default values.   ContainerFields are well <br>
>> known that I strip those out in X3DJSONLD.java...should be an easy fix.<br>
>><br>
>> HWPJSON.x3d is pretty printed X3D XML output from JsonConversion, and <br>
>> HWPO.x3d is pretty printed HelloWorldProgramOutput.x3d (see xmllint <br>
>> commands below).<br>
>><br>
>> Note that DISEntityTypeMapping is in the XML DOM output from <br>
>> JsonConversion.java (HWP.x3d), perhaps there's a problem with <br>
>> X3DLoaderDOM?<br>
>><br>
>><br>
>> LoadSensor children don't seem to be handled in X3DLoaderDOM?<br>
>><br>
>><br>
>> I can post output from running JsonConversion.java, if desired, it's <br>
>> kind of long.  I have already posted how to compile and run.<br>
>><br>
>> /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/src$" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/src$</a> cat <br>
>> ../examples/HelloWorldProgramOutput.x3d | xmllint --format - > HWPO.x3d<br>
>> /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/src$" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/src$</a> cat <br>
>> examples/Json.x3d | xmllint --format - > HWPJSON.x3d<br>
>><br>
>> /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/src$" rel="noreferrer" target="_blank">www.web3d.org/x3d/stylesheets/java/src$</a> diff HWPJSON.x3d <br>
>> HWPO.x3d<br>
>> 40,42d39<br>
>> <     <meta content="04 February 2021" name="translated"/><br>
>> <     <meta content="X3dToJson.xslt, <br>
>> <a href="https://www.web3d.org/x3d/stylesheets/X3dToJson.html" rel="noreferrer" target="_blank">https://www.web3d.org/x3d/stylesheets/X3dToJson.html</a>" name="generator"/><br>
>> <     <meta content="X3D JSON encoding: <br>
>> <a href="https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding" rel="noreferrer" target="_blank">https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding</a>" <br>
>> name="reference"/><br>
>> 44a42<br>
>> >     <MetadataSet name="topLevelSceneMetadata"/><br>
>> 223c221<br>
>> <<br>
>> ---<br>
>> ><br>
>> 298a297,299<br>
>> >       <ProtoInstance DEF="Proto1" name="NewWorldInfo"><br>
>> >         <fieldValue name="description" value="testing 1 2 3"/><br>
>> >       </ProtoInstance><br>
>> 301a303<br>
>> >       <ProtoInstance DEF="Proto3" name="NewWorldInfo"/><br>
>> 337c339,341<br>
>> <       <DISEntityManager/><br>
>> ---<br>
>> >       <DISEntityManager><br>
>> >         <DISEntityTypeMapping/><br>
>> >       </DISEntityManager><br>
>> 345c349,351<br>
>> <     <DISEntityManager/><br>
>> ---<br>
>> >     <DISEntityManager><br>
>> >       <DISEntityTypeMapping/><br>
>> >     </DISEntityManager><br>
>> 348a355,367<br>
>> >       <Anchor USE="siteAnchor"/><br>
>> >       <Inline USE="inlineScene"/><br>
>> >       <DISEntityTypeMapping/><br>
>> >       <GeoMetadata/><br>
>> >       <AudioClip containerField="children"/><br>
>> >       <ImageCubeMapTexture containerField="children"/><br>
>> >       <ImageTexture3D containerField="children"/><br>
>> >       <ImageTexture containerField="children"/><br>
>> >       <MovieTexture containerField="children"/><br>
>> >       <Script/><br>
>> >       <PackagedShader containerField="children"/><br>
>> >       <ShaderPart containerField="children"/><br>
>> >       <ShaderProgram containerField="children"/><br>
</blockquote></div></div>