json:response

Purpose

Container for the JSON elements in a response page, i.e. a page sent as an answer to an AJAX request. The element ensures that the response has the correct type of application/json.

Contains

Example

<json:response xmlns:json="http://www.volantis.com/xmlns/2009/07/json"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.volantis.com/xmlns/2009/07/json
    http://www.volantis.com/schema/2009/07/xdime2/json.xsd">
  <!--
    ! Define some data.
    !
    ! This is equivalent to the following JSON.
    !
    ! {
    !     total: 36,
    !     channels: [
    !         {
    !             type: "feed",
    !             title: "News",
    !             url: "news.xdime",
    !         },
    !         {
    !             type: "external",
    !             title: "Facebook",
    !             url: "http://www.facebook.com/",
    !         },
    !     ]
    ! }
    !-->
  <json:object>
    <json:property name="total">
      <json:number>36</json:number>
    </json:property>
    <json:property name="channels">
      <json:array>
        <json:object>
          <json:property name="type">
            <json:string>feed</json:string>
          </json:property>
          <json:property name="title">
            <json:string>News</json:string>
          </json:property>
          <json:property name="url">
            <json:string>news.xdime</json:string>
          </json:property>
        </json:object>
        <json:object>
          <json:property name="type">
            <json:string>external</json:string>
          </json:property>
          <json:property name="title">
            <json:string>Facebook</json:string>
          </json:property>
          <json:property name="url">
            <json:string>http://www.facebook.com/</json:string>
          </json:property>
        </json:object>
      </json:array>
    </json:property>
  </json:object>
</json:response>

Related topics