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

Clement IGONET clement at igonet.fr
Thu Sep 3 05:17:20 PDT 2015


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> wrote:

> Available here: http://coderextreme.net/x3djson.js
>
> John
>
>
> On Sep 2, 2015, at 4:52 PM, John Carlson <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>
> 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
> https://lists.sourceforge.net/lists/listinfo/x3dom-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20150903/c4327099/attachment.html>


More information about the x3d-public mailing list