Raw output 0.10

This article documents the schema of the raw output produced by Berlioz.

Element guide

Element: root

The root element wraps the content return by Berlioz.

The service attribute is often used in XSLT to specify which template to apply.

Attributes

namedescription
serviceThe ID service of the service that was used
groupThe group the service belongs to

Elements

namedescription
headerThe header contains information about the Berlioz service
contentA content element is returned for each content generator defined for the service.

Schema

DTD
<!ELEMENT root                                          ( header, content* ) >
<!ATTLIST root     service           NMTOKEN                       #REQUIRED
                   group             NMTOKEN                       #REQUIRED >
Relax schema
element root {
  attribute service { xs:string },
  attribute group { xs:string },
  ( header, content* )
}

 

Element: header

The header element contains metadata about the Service including the parameters being passed, the path information, URL details and the Berlioz version.

<header>
  <location > ... </location>
  <path />
  <http-parameters> ... </http-parameters>
  <uri-parameters> ... </uri-parameters>
  <berlioz version="" mode="">
</header>

Elements

namedescription
locationThe location of the service includes URL information
pathInformation about the Berlioz path
http-parametersParameters supplied as HTTP query parameters
uri-parametersParameters extracted from the URI pattern in the path component of the URL
berliozBerlioz version and current mode.

Schema

DTD
<!ELEMENT header (location, path, http-parameters?, uri-parameters?, berlioz)>
Relax
element header {
  (location, path, http-parameters?, uri-parameters?, berlioz)
}

 

Element: location

The location element contains the URL to the current service split into its different components so that it can be easily extracted in XSLT.

<location scheme="http"
            host="example.org"
            port="80"
            path="/search.html"
           query="q=test" 
            base="http://example.org"
>http://example.org/search.html?q=test</location>

Attributes

namedescription
schemeThe scheme component of the URL: http or https
hostThe host component of the URL
portThe actual port number for the URL even if default port is used (e.g. 80 or 443)
pathThe path component of the URL
queryThe query component of the URL (without the '?')
baseThe scheme, host, port that can be used to reconstruct URLs easily.

Schema

DTD
<!ELEMENT location                                               ( #PCDATA ) >
<!ATTLIST location  scheme              CDATA                   #REQUIRED
                    host                CDATA                   #REQUIRED   
                    port                CDATA                   #REQUIRED
                    path                CDATA                   #REQUIRED
                    query               CDATA                   #REQUIRED
                    base                CDATA                   #REQUIRED >
Relax
element location {
  attribute scheme { "http" | "https"},
  attribute host { xs:string },
  attribute port { xs:integer },
  attribute path { xs:string },
  attribute query { xs:string },
  attribute base { xs:string },
  text
}

 

Element: path

The path element splits the path component of the URL to expose what part was used to match against the URI pattern (attribute info) and which part  was used for selecting the template (attribute prefix or extension).

Whether the path element will include the prefix or the extension element is based on the Berlioz Servlet mapping and is fixed for the entire application. In the standard mapping, the extension attribute is used.

<path info="/search" extension=".html"/>

Attributes

namedescription
infoThe part of the path that is matched against the URI pattern for selecting the service
prefixThe prefix of the path used for template selection
extensionThe suffix (i.e. extension) of the path used for template selection.

Schema

DTD
<!ELEMENT path                                                   ( EMPTY ) >
<!ATTLIST path  info                     CDATA                   #REQUIRED
                prefix                   CDATA                   #REQUIRED
                extension                CDATA                   #REQUIRED >
Relax
element path {
  attribute info { xs:string },
  attribute prefix { xs:string }?,
  attribute extension { xs:integer }?
}

 

Element: http-parameters

The wrapper for the HTTP parameters.

They can be received as part of:

  • the query component of the URL (e.g. via method GET)
  • and/or the application/x-www-form-urlencoded content (e.g. via POST method)

When multiple parameters have the same name, they are provided in the order they are specified in the query.

Example

If the URL sent was /search.html?q=test, than the header will include the following:

<http-parameters>
   <parameter name="q">test</parameter>
</http-parameters>

Elements

namedescription
parameterindividual parameters

Schema

DTD
<!ELEMENT http-parameters                                     ( parameter* ) >
Relax
element http-parameters {
  parameter*
}

 

Element: uri-parameters

The wrapper for the parameters included in the path component of the URL and extracted from URI pattern matching.

Example

If a service matches /accounts/{account}, and the URL sent was /account/jsmith.html, than the header will include the following:

<uri-parameters>
   <parameter name="account">jsmith</parameter>
</uri-parameters>

Elements

namedescription
parameterindividual parameters

Schema

DTD
<!ELEMENT uri-parameters                                     ( parameter* ) >
Relax
element uri-parameters {
  parameter*
}

 

Element: parameter

URI and HTTP parameters are included in the header as parameter elements.

Note

Characters are properly escaped so that they produce valid XML.

Examples

<parameter name="email">test@example.org</parameter>

<parameter name="id">87253402537</parameter>

<parameter name="hack"><script src="alert()"/&gt;</parameter>

Attributes

namedescription
nameThe name of the parameter

Schema

DTD
<!ELEMENT parameter                                            ( #PCDATA ) >
<!ATTLIST parameter name                CDATA                    #REQUIRED >
Relax
element parameter {
  attribute name { xs:string},
  text
}

 

Element: berlioz

The berlioz element provides information about the current version and mode of Berlioz in the application. These valued are fixed while the application is running.

Examples

<berlioz version="0.10.2" mode="local"/>

Attributes

namedescription
versionThe version of Berlioz in use
modeThe current mode for the application

Schema

DTD
<!ELEMENT berlioz                                                  ( EMPTY ) >
<!ATTLIST berlioz version               CDATA                    #REQUIRED
                  mode                  CDATA                    #REQUIRED >
Relax
element berlioz {
  attribute version { xs:string},
  attribute mode { xs:string }
}

 

Element: content

Each content element corresponds to a generator in the matching service.

The generator, name and target attributes correspond exactly to the same attributes on the generator element in the services.xml.

The etag and status attributes are specified after the generator has been invoked.

Additional profiling attributes are added only when the Berlioz parameter berlioz-profile is specified and set to true. These should not be used in production.

Examples

<content generator="org.example.GetUser"
              name="user"
            target="header"
              etag="gH7rtA83BjxpwJt032"
            status="ok">
  ...
</content>

Attributes

namedescription
generatorThe full name of the Java class of the ContentGenerator instance
nameThe name for the generator
targetThe target for the generator
statusThe status after the generator was invoked
etagThe etag of the response if the generator is Cacheable
profile-etagThe time in ms taken to generate the etag for the response of the generator
profile-contentThe time in ms taken to generate the response content of the generator
profileThe time in ms taken by the generator to process (etag+content)

Schema

DTD
<!ELEMENT content                                                 ( EMPTY ) >
<!ATTLIST content generator            CDATA                    #REQUIRED
                  name                 CDATA                    #REQUIRED
                  target               CDATA                    #REQUIRED
                  status               CDATA                    #REQUIRED
                  etag                 CDATA                    #REQUIRED
                  mode                 CDATA                    #REQUIRED
                  profile-etag         CDATA                    #REQUIRED
                  profile-content      CDATA                    #REQUIRED
                  profile              CDATA                    #REQUIRED
 >
Relax
element berlioz {
  attribute generator { xs:string},
  attribute name { xs:string },
  attribute target { xs:string },
  attribute status { xs:string },
  attribute etag { xs:string },
  attribute profile-etag { xs:string },
  attribute profile-content { xs:string },
  attribute profile { xs:string },
  any
}

 

Created on , last edited on