But what about the standards? Open Geospatial Consortium defines more than 50 specifications with more than 100 individual versions. Technically almost all of them are XML-based and defined by XML schemas. These are de jure and de facto standards, widely used and well supported. So you still need XML processing in JS web mapping apps.
Processing XML is no rocket science, but it's seldom a pleasure to implement. The OL3 KML parser is about 2.5KLoc of dense XML parsing. Even a very simple WMS GetCapabilities format is almost 1 KLOC. From this code around 90% is pure XML parsing and only 10% is the processing of the payload.
Would not it be nice if we could talk to the OGC Web Services directly in JSON? So that the developers could focus on the 10%, the payload processing, and cut off the 90% (XML handling) of the effort.
Jsonix is an open source library for XML JS conversion which makes it just possible.
With Jsonix you can take an XML Schema and generate XMLJS mappings. These mappings allow you to parse XML in the original schema and get your data in pretty JSON. It also works in the opposite direction: you can serialize JSON in XML, which would correspond to the original XML Schema.
What makes Jsonix unique is that it is type and structure-safe. On the JSON side, you will get types and structures exactly as they are defined in the original XML Schema. For instance, xs:decimal is converted into a number in number in JSON, repeatable elements are represented by arrays etc. You just need the corresponding mapping.
You can generate Jsonix mappings on your own or use one of the pre-generated mappings. The (unofficial) OGC Schemas Project compiles and provides mappings for many of the popular OGC schemas (OWS, WMS, WFS, CSW, SLD and many more).
This presentation gives an overview of Jsonix demonstrates its usage by a number of examples.