Aeson

The Aeson format defines a transformation from XML to JSON that Berlioz uses to generate JSON.

Berlioz implemented so that the XML is not actually generated, instead of XML events are converted directly into JSON using the Aeson format.

Example

The XML below

<root version="1.0">
  <person id="4" name="Ali Baba"/>
</root>

Will be serialized as

{
  "version": "1.0",
  "person": {
    "id": "4",
    "name": "Ali Baba"
  }
}

 

XSLT module

An XSLT module making use of the Aeson format would typically look like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:json="http://pageseeder.org/JSON"
                exclude-result-prefixes="#all">

<!-- JSON output properties -->
<xsl:output method="xml" media-type="application/json" encoding="utf-8"/>

<!-- Default -->
<xsl:template match="/root">
<json:object/>
</xsl:template>

</xsl:stylesheet>

Created on , last edited on