[x3d-public] Bad ECMAScript in X3DJSAIL JSON output; multiple corrections applied tested committed and deployed

John Carlson yottzumm at gmail.com
Mon Mar 19 04:09:02 PDT 2018


Don, I just want to make sure you're fixing the Ecmascript.  I am less
concerned about comments, except to make them arrays.

John

On Mar 19, 2018 12:58 AM, "Don Brutzman" <brutzman at nps.edu> wrote:

John, thanks for the error reports, was able to spend some more time on
those.

I think I've finally fixed the longstanding X3dToJson.xslt woes with
escaping of quote marks.  The essential problem was trying to treat
escaping of SFString values the same as escaping of comments.  That
recursion block is now split into two separate blocks.

Escaping of comments is actually much easier, only have to worry about
characters \ and " plus combinations thereof.  Even more careful
choreography is now engineered into the XSLT stylesheet.

Initial test cases pass satisfactorily.  Have checked in X3dToJson.xslt
modifications (which generates all JSON for X3DJSAIL and examples).

First updated from subversion to ensure that any nashorn modifications from
you are pulled down, and then deployed update to X3DJSAIL.

Have further made some minor improvements in X3dToX3dom.xslt to support
X3DOM capabilities in X3D Validator.

Also added regex tests in X3D Validator to check for presence of proper
.css and .js entries.  Press "Validate" on:
https://savage.nps.edu/X3dValidator?url=http://www.web3d.
org/x3d/content/examples/HelloWorldX3dom.xhtml

Testing uncovered an emergent flaw in the X3D JSON schema which is still
requiring ProtoInstance USE to have a @name (but that name field is no
longer allowed/required).

Also running updates overnight on all examples on all JSON conversions of
X3D Examples Archives, which includes jsonlint and X3D JSON Schema testing
throughout - fingers crossed!  So far so good, will upload new builds
during work tomorrow.

Am not applying the following patch since prior problems seem to be handled
separately by these various changes.

Recommend refresh and review.  When convenient, please let me know what you
think.

So... back in motion to good effect.  Have fun with X3D JSON, X3DJSAIL and
X3D Validator!  8)


On 3/17/2018 2:03 PM, John Carlson wrote:

> Possibly related to this patch…what do you think?   Web site appears okay,
> so I am confused.  My local build has problems, ran ant all in
> x3d/stylesheets/java.   Files not updating in java/examples, so puzzled.
> Website appears okay.  Files in x3d/stylesheets/java/classes up to date,
> but still have same issue.  Hmm.  May try flipping this back.   Most
> successful with my DOM2JSONSerializer (no stylesheet).  Worst time going
> through a Java X3DJSAIL program to produce JSON.
>
> What process generates the JSON on the website for java/examples?
> http://www.web3d.org/x3d/stylesheets/java/examples/HelloWorl
> dProgramOutput.json  that looks ideal, AFAICT.
>
> John
>
> $ svn diff X3d*
>
> Index: X3dToJson.xslt
>
> ===================================================================
>
> --- X3dToJson.xslt      (revision 26501)
>
> +++ X3dToJson.xslt      (working copy)
>
> @@ -73,7 +73,7 @@
>
>       <xsl:param name="stripComments"><xsl:text
> >false</xsl:text></xsl:param>
>
>       <xsl:param name="stripDefaultAttributes">
> <xsl:text>true</xsl:text></xsl:param>
>
>       <xsl:param name="indentEnabled"><xsl:text
> >true</xsl:text></xsl:param>
>
> -    <xsl:param name="normalizeCommentWhitespa
> ce"><xsl:text>true</xsl:text></xsl:param>
>
> +    <xsl:param name="normalizeCommentWhitespa
> ce"><xsl:text>false</xsl:text></xsl:param>
>
>       <xsl:param name="sourceText"><xsl:text>strings</xsl:text></xsl:param>
> <!-- escaped | strings | plaintext -->
>
>       <xsl:param name="traceEnabled" ><xsl:text>false</xsl:text></x
> sl:param>
>
>       <xsl:param name="traceScripts" ><xsl:text>false</xsl:text></x
> sl:param>
>
> John
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Saturday, March 17, 2018 3:33 PM
> *To: *Don Brutzman <mailto:brutzman at nps.edu>; x3d-public at web3d.org
> <mailto:x3d-public at web3d.org>
> *Subject: *Bad ECMAScript in X3DJSAIL JSON output
>
> See overrunning comments in ECMAScript in x3d-code/www.web3d.org/x3d/sty
> lesheets/java/examples/HelloWorldProgramOutput.json
>


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180319/06c12b05/attachment.html>


More information about the x3d-public mailing list