Jsonix FOSSGIS2015 Demo - CSW GetRecords

by Alexey Valikov

HTML

<script src="https://rawgit.com/highsource/jsonix/2.1.1/dist/Jsonix-all.js"></script>
<script src="https://rawgit.com/highsource/w3c-schemas/1.0.3/scripts/lib/XLink_1_0.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/CSW_2_0_2.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/DCT.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/DC_1_1.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/OWS_1_0_0.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/Filter_1_1_0.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/GML_3_1_1.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/SMIL_2_0_Language.js"></script>
<script src="https://rawgit.com/highsource/ogc-schemas/2.0.2/scripts/lib/SMIL_2_0.js"></script>
<pre id="log"></pre>

JavaScript

var url = "https://rawgit.com/highsource/jsonix/master/fiddles/yq8x0oqf/GetRecords.xml";

var mappings = [XLink_1_0, SMIL_2_0, SMIL_2_0_Language, GML_3_1_1, OWS_1_0_0, Filter_1_1_0, DC_1_1, DCT, CSW_2_0_2];

// Create a Jsonix context
var context = new Jsonix.Context(mappings);

// Create an unmarshaller (parser)
var unmarshaller = context.createUnmarshaller();

// Unmarshal from URL
unmarshaller.unmarshalURL(url, function(result) {
    // Display the results
    $('#log').html(JSON.stringify(result, null, 2));
});