<div dir="ltr">Hi,<div><br></div><div>here's a short update on the Jsonix progress in the last days.</div><div><br></div><div>We've started the OGC Schema project on GitHub (<a href="https://github.com/highsource/ogc-schemas">https://github.com/highsource/ogc-schemas</a>). OGC Schemas compiles (as you guess) OGC Schemas producing JAXB schema-derived classes as well as Jsonix mappings:</div>
<div><br></div><div><a href="https://github.com/highsource/ogc-schemas/tree/master/scripts">https://github.com/highsource/ogc-schemas/tree/master/scripts</a><br></div><div><br></div><div>With this project, there will be no need to compile the schemas on your own. Just take the already compiled mappings. In code it looks as follows:</div>
<div><br></div><div><pre style="overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:0px;padding:16px;line-height:1.45;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-wrap:normal;word-break:normal;color:rgb(51,51,51);background-color:rgb(247,247,247)">
<span class="" style="font-weight:bold">var</span> <span class="">XLink_1_0</span> <span class="" style="font-weight:bold">=</span> <span class="">require</span><span class="">(</span><span class="" style="color:rgb(221,17,68)">'W3C-Schemas'</span><span class="">).</span><span class="">XLink_1_0</span><span class="">;</span>
<span class="" style="font-weight:bold">var</span> <span class="">OWS_1_1_0</span> <span class="" style="font-weight:bold">=</span> <span class="">require</span><span class="">(</span><span class="" style="color:rgb(221,17,68)">'OGC-Schemas'</span><span class="">).</span><span class="">OWS_1_1_0</span><span class="">;</span>
<span class="" style="font-weight:bold">var</span> <span class="">WPS_1_0_0</span> <span class="" style="font-weight:bold">=</span> <span class="">require</span><span class="">(</span><span class="" style="color:rgb(221,17,68)">'OGC-Schemas'</span><span class="">).</span><span class="">WPS_1_0_0</span><span class="">;</span>

<span class="" style="font-weight:bold">var</span> <span class="">context</span> <span class="" style="font-weight:bold">=</span>  <span class="" style="font-weight:bold">new</span> <span class="">Jsonix</span><span class="">.</span><span class="">Context</span><span class="">([</span><span class="">XLink_1_0</span><span class="">,</span> <span class="">OWS_1_1_0</span><span class="">,</span> <span class="">WPS_1_0_0</span><span class="">]);</span>
<span class="" style="font-weight:bold">var</span> <span class="">unmarshaller</span> <span class="" style="font-weight:bold">=</span> <span class="">context</span><span class="">.</span><span class="">createUnmarshaller</span><span class="">();</span>
<span class="">unmarshaller</span><span class="">.</span><span class="">unmarshalFile</span><span class="">(</span><span class="" style="color:rgb(221,17,68)">"tests/WPS/1.0.0/execute-01.xml"</span><span class="">,</span> <span class="" style="font-weight:bold">function</span><span class="">(</span><span class="">result</span><span class="">)</span> <span class="">{</span>
    <span class="">test</span><span class="">.</span><span class="">equal</span><span class="">(</span><span class="" style="color:rgb(221,17,68)">"geom"</span><span class="">,</span> <span class="">result</span><span class="">.</span><span class="">value</span><span class="">.</span><span class="">dataInputs</span><span class="">.</span><span class="">input</span><span class="">[</span><span class="" style="color:rgb(0,153,153)">0</span><span class="">].</span><span class="">title</span><span class="">.</span><span class="">value</span><span class="">);</span>
    <span class="">test</span><span class="">.</span><span class="">done</span><span class="">();</span>
<span class="">});</span></pre></div><div><br></div><div><br></div><div>This is code above a node.js version, will look similar in browser. Just include OGC-Schemas/OWS_1_1_0.js.</div><div>RequireJS/AMD is supported out of the box.</div>
<div><br></div><div><div>See the Jsonix tests for OGC Schemas here:</div><div><a href="https://github.com/highsource/ogc-schemas/tree/master/scripts/tests">https://github.com/highsource/ogc-schemas/tree/master/scripts/tests</a><br>
</div></div><div><br></div><div>The first version (2.0.0 due to historic reasons) already published to NPM:</div><div><br></div><div><a href="https://www.npmjs.org/package/ogc-schemas">https://www.npmjs.org/package/ogc-schemas</a><br>
</div><div><br></div><div>Bower registration will come in one of the next versions.</div><div><br></div><div>Last days I\ve been adding more and more schemas, here's what is currently supported:</div><div><br></div><div>
<div>* Filter_1_0_0</div><div>* Filter_1_1_0</div><div>* Filter_2_0</div><div>* GML_2_1_2</div><div>* GML_3_1_1</div><div>* SMIL_2_0</div><div>* SMIL_2_0_Language</div><div>* OWS_1_0_0</div><div>* OWS_1_1_0</div><div>* OWS_2_0</div>
<div>* WCS_1_0_0</div><div>* WCS_1_1</div><div>* WFS_1_0_0</div><div>* WFS_1_1_0</div><div>* WFS_2_0</div><div>* WMS_1_0_0</div><div>* WMS_1_1_0</div><div>* WMS_1_1_1</div><div>* WMS_1_3_0</div><div>* WPS_1_0_0</div></div>
<div><br></div><div>So I think in a couple of days we'll support everything the Python OWSLib supports. I takes ca. 15-30 min to add a new schema/version.</div><div><br></div><div>I have to admit that there were a couple of problems compiling these schemas, however everything was very well resolveable. Jsonix 2.0.12 and Jsonix Schema Compiler 2.1.0 are published now (NPM, Bower, Maven Central).</div>
<div><br></div><div><br></div><div>I would like to thank Bart van den Eijnden for his great help a lot with the project.</div><div><br></div><div><br></div><div>Now I'd like to addres a few points from <span style="font-size:13px;font-family:arial,sans-serif">Éric Lemoine's mail:</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">* Jsonix creates plain JavaScript objects with almost no own types. Few exceptions are QNames and DateTime/Calendar types (both can be avoided).</span><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">* Jsonix only addresses XML parsing/serializing (unmarshalling/marshalling) XML into JavaScript and vice versa. Jsonix on its own will not create instances of OL or Leaflet classes, this is not in scope. The purpose of Jsonix is to releave you from the XML parsing/serializing peculiarities so that you can concentrate on the pure JavaScript payload in a predictable form.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">* Jsonix works with OL2 in any case and will be able to work in OL 3. Not tested yet but I don't expect problems there. Leaflet should also be no problem. In fact, should work basically with anything since I'm extremely cautious about globals pollution and such things.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">* Jsonix is not yet Closure-ready but I think this is an important feature and this will be implemented. So you should be able to use a fraction of formats then.</span></div>
<div><br></div><div><span style="font-family:arial,sans-serif">Best wishes,</span><br></div><div><font face="arial, sans-serif">Alexey</font></div><div><br></div></div>