[x3d-public] renewed development of X3D JSON support

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Tue Oct 12 00:58:00 PDT 2021


Regular expressions are icing on top of the gravy and an extra independent layer of validation checking string patterns for simple types (well-formed floats etc.) so not necessary for most element/attribute evaluation.

All of the detail is in the schema, meanwhile HelloWorld.json is almost certainly correct given all the torment it has received.

We can report issues to (a) Altova or (b) AJV if you think it worthwhile.

I’d press on.  It is always interesting to see how other tools work.

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

From: John Carlson<mailto:yottzumm at gmail.com>
Sent: Tuesday, October 12, 2021 12:52 AM
To: Brutzman, Donald (Don) (CIV)<mailto:brutzman at nps.edu>; X3D Graphics public mailing list<mailto:x3d-public at web3d.org>
Subject: Re: renewed development of X3D JSON support

NPS WARNING: *external sender* verify before acting.


I've put the converted schema through the Ajv 8 validator. Here's what
I've gotten so far, with HelloWorld.json.  I don't know if the problem
stems from Ajv or the schema, or the HelloWorld.json.  One reason why I
had to take out pattern match was the XML Schema regular expressions
were not the same as the JavaScript regular expressions.  I'm not sure
how portable regular expressions are between encodings, in other words.
Any I don't really know what XMLSpy has done.  Maybe check documentation
about regexps on Altova's website.

John


~/x3dschema$ node validatex3djson.js
/c/x3d-code/www.web3d.org/x3d/content/examples/HelloWorld.json
Failed JSON parse
/c/x3d-code/www.web3d.org/x3d/content/examples/HelloWorld.json
SyntaxError: Invalid regular expression:
/^([\d\--\.\:A-Z_a-z·À-ÖØ-öø-ͽͿ-ٟ٪-ۯۺ-޿ߊ-॥॰-৥ৰ-੥ੰ-૥૰-୥୰-௥௰-౥౰-೥೰-൥൰-෥෰-๏๚-໏໚-༟༪-ဿ၊-ႏႚ-៟៪-᠏᠚-᥅ᥐ-᧏᧚-᩿᪊-᪏᪚-᭏᭚-ᮯᮺ-᰿᱊-ᱏᱚ-῿-‿-⁀⁰-↏Ⰰ-⿯、-ꘟꘪ-꣏꣚-ꤊ-ꧏ꧚-ꧯꧺ-꩏꩚-꯯꯺-퟿豈-﷏ﷰ-/:-�𐀀-𐒟𐒪-𑁥𑁰-𑃯𑃺-𑄵𑅀-𑇏𑇚-𑋯𑋺-𑑏𑑚-𑓏𑓚-𑙏𑙚-𑚿𑛊-𑜯𑜺-𑣟𑣪-𑱏𑱚-𖩟𖩪-𖭏𖭚-𝟍𝠀-𞥏𞥚-󯿿]+)$/:
Invalid escape
     at new RegExp (<anonymous>)
     at usePattern
(/home/coderextreme/x3dschema/node_modules/ajv/dist/vocabularies/code.js:72:14)
     at Object.code
(/home/coderextreme/x3dschema/node_modules/ajv/dist/vocabularies/validation/pattern.js:19:109)
     at keywordCode
(/home/coderextreme/x3dschema/node_modules/ajv/dist/compile/validate/index.js:454:13)
     at
/home/coderextreme/x3dschema/node_modules/ajv/dist/compile/validate/index.js:222:17
     at CodeGen.code
(/home/coderextreme/x3dschema/node_modules/ajv/dist/compile/codegen/index.js:439:13)
     at CodeGen.block
(/home/coderextreme/x3dschema/node_modules/ajv/dist/compile/codegen/index.js:568:18)
     at iterateKeywords
(/home/coderextreme/x3dschema/node_modules/ajv/dist/compile/validate/index.js:219:9)
     at groupKeywords
(/home/coderextreme/x3dschema/node_modules/ajv/dist/compile/validate/index.js:200:13)
     at
/home/coderextreme/x3dschema/node_modules/ajv/dist/compile/validate/index.js:192:13

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


More information about the x3d-public mailing list