[x3d-public] [x3dom-users] steps to create your own JSON schema for X3D Web from XML Schema

clement at igonet.fr clement at igonet.fr
Thu Sep 3 11:07:30 PDT 2015


Very nice. I'll exploit it very soon.
Thx

Le 3 septembre 2015 19:31:32 UTC+02:00, John Carlson <john at carlsonsolutiondesign.com> a écrit :
>I found this, which you might be able to adapt or use: 
>https://github.com/coderextreme/X3DJSONTOD3/blob/master/JSON2X3D.js
>
>John
>On Sep 3, 2015, at 12:28 PM, John Carlson
><john at carlsonsolutiondesign.com<mailto:john at carlsonsolutiondesign.com>>
>wrote:
>
>What I would do is convert back to XML and do a diff of the two XML
>documents.  I have something that generates XML from JSON, if you are
>interested, but I don’t think its the JSON you would expect.
>
>John
>On Sep 3, 2015, at 7:17 AM, Clement IGONET
><clement at igonet.fr<mailto:clement at igonet.fr>> wrote:
>
>Sounds good.
>Currently, I'm working on a nodejs project and I need to check if the
>json data I've just created match to a valid X3D (xml) content.
>Is there already something available for such a conversion?
>
>Clement.
>
>On Wed, Sep 2, 2015 at 11:59 PM, John Carlson
><john at carlsonsolutiondesign.com<mailto:john at carlsonsolutiondesign.com>>
>wrote:
>Available here: http://coderextreme.net/x3djson.js
>
>John
>
>
>On Sep 2, 2015, at 4:52 PM, John Carlson
><john at carlsonsolutiondesign.com<mailto:john at carlsonsolutiondesign.com>>
>wrote:
>
>Running
>
>$ java -jar
>jsonix-schema-compiler/full/target/jsonix-schema-compiler-full-2.3.7-SNAPSHOT.jar
>x3d-3.4.xsd  -b x3d.xjb -p x3djson
>
>will create x3djson.js with x3djson variable defined
>
>John
>
>On Sep 2, 2015, at 4:28 PM, John Carlson
><john at carlsonsolutiondesign.com<mailto:john at carlsonsolutiondesign.com>>
>wrote:
>
>I ran the following with full path names.  I have not verified this
>script.  Use at your own risk!   But it should work.  If you don’t want
>to bother, see the attached JSON schema file.
>
>Download Maven 3
>
>Download https://github.com/highsource/jsonix-schema-compiler/
>
>$ git clone https://github.com/highsource/jsonix-schema-compiler/
>
>$ cd jsonix-schema-compiler
>
>$ mvn install
>
>Download X3D 3.4 schema
>
>$ wget http://www.web3d.org/specifications/x3d-3.4.xsd
>$ wget
>http://www.web3d.org/specifications/x3d-3.4-Web3dExtensionsPublic.xsd
>$ wget
>http://www.web3d.org/specifications/x3d-3.4-Web3dExtensionsPrivate.xsd
>
>$ java -jar full/target/jsonix-schema-compiler-full-2.3.7-SNAPSHOT.jar
>x3d-3.4.xsd
>
>Look at generated.js
>
>
>Note that there’s an error from the command-line.  This page:
>http://techiquest.blogspot.com/2012/02/xml-schema-to-java-binding-large.html
>says to change the configuration like this:
>
>
><jaxb:bindings
>
>     schemaLocation="file:SWIFT-FIN-November-2011-Data-Dictionary.xsd">
>        <jaxb:bindings>
>            <jaxb:globalBindings typesafeEnumMaxMembers="600"/>
>        </jaxb:bindings>
></jaxb:bindings>
>
>
>
>However, I created my own x3d.xjb file that look like this:
>
><?xml version="1.0" ?>
><bindings version="1.0" xmlns="http://java.sun.com/xml/ns/jaxb"
>schemaLocation="x3d-3.4.xsd">
>        <bindings>
>            <globalBindings typesafeEnumMaxMembers="600"/>
>        </bindings>
></bindings>
>
>
>And ran:
>
>$ java -jar full/target/jsonix-schema-compiler-full-2.3.7-SNAPSHOT.jar
>x3d-3.4.xsd  -b x3d.xjb
>
>
>without errors. Hopefully the generated.js will work for you. 
>Attached.
><generated.js>
><x3d.xjb>
>http://coderextreme.net/generated.js
>http://coderextreme.net/x3d.xjb
>Note that this schema does not comply with the current X3D JSON
>proposed standard.  I suggest we start with the JSON schema and modify
>it to suit our needs.
>
>
>
>
>
>------------------------------------------------------------------------------
>Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>Get real-time metrics from all of your servers, apps and tools
>in one place.
>SourceForge users - Click here to start your Free Trial of Datadog now!
>http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>_______________________________________________
>X3dom-users mailing list
>X3dom-users at lists.sourceforge.net<mailto:X3dom-users at lists.sourceforge.net>
>https://lists.sourceforge.net/lists/listinfo/x3dom-users

clement at igonet.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20150903/46e031ce/attachment-0001.html>


More information about the x3d-public mailing list