[x3d-public] X3DJSAIL updates

John Carlson yottzumm at gmail.com
Sun Dec 17 12:33:18 PST 2017


But there may be a difference in the stylesheet engine invocation.

Then we may need to look at intermediate XML generated from X3DJSAIL compared to original XML.

Do these three conversions:

Java -> JSON (Native Java stylesheet engine).
XML (output from Java) -> JSON (I do this with Saxon, let me know if I shouldn’t, or perhaps I have an old version)
XML (output from Java) -> Java -> JSON (Native Java stylesheet engine).

[ my last one goes from XML -> JSON -> DOM before going to Java ]

With HelloWorldProgramOutput.x3d and HelloWorldProgram.java

And compare JSON outputs.  They should be the same?  Yet they are all different.  DIFF3 follows/

Please compare on your system, since the source code isn’t synced yet.  There may be a stylesheet engine issue.  I have been switching to NATIVE_JAVA engine, but neither of them produce proper JSON inside JavaScript.  One has extra newlines, and the other has extra \’s

In other words, we need a better, more reliable DOM->JSON conversion.  Or we need to pick a stylesheet engine and make it work for all cases.  X3DJSONLD uses RunSaxon.java to run stylesheets. Trying to stir up some interest.

$ diff3 !*
diff3 HelloWorldProgramOutput.json /c/x3d-code/www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json HelloWorldProgramOutput.new.json
====2
1:323c
3:323c
                                  "-metadata":
2:323,329c
                                  "-value":[
                                    { "MetadataString":
                                      {
                                        "@name":"escapedQuotesTest1",
                                        "@value":["escaped quotation marks example 1: He said, \"Immel did it!\""]
                                      }
                                    },
====2
1:329a
3:329a
2:336c
                                  ]
====2
1:347c
3:347c
                        },
2:354,356c
                        }
                      ],
                      "-proxy":
====2
1:370c
3:370c
                      ]
2:378a
====3
1:593,595c
2:601,603c
                        }
                      ],
                      "-material":
3:593c
                        },
====3
1:611a
2:619a
3:610c
                      ]
====3
1:632,634c
2:640,642c
                        }
                      ],
                      "-material":
3:631c
                        },
====3
1:651a
2:659a
3:649c
                      ]
====3
1:673,675c
2:681,683c
                        }
                      ],
                      "-material":
3:671c
                        },
====3
1:680a
2:688a
3:677c
                      ]
====3
1:892,894c
2:900,902c
                              }
                            ],
                            "-material":
3:889c
                              },
====3
1:900a
2:908a
3:896c
                            ]
On 12/17/2017 10:29 AM, John Carlson wrote:
> I believe this happens because -children is generated instead of -material in the Java -> JSON generation.   I don’t believe -children is valid at this point, since addChild is also unavailable.

There is no special Java -> JSON generation on my end, only X3dToJSON.xslt invocation.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171217/d7e6861a/attachment.html>


More information about the x3d-public mailing list