Appendix B. WAM XML Structure

The XML document produced from a WEBROUTINE invocation at runtime has a standard format. All fields, lists and other output from a WEBROUTINE are defined in the XML document. This XML document is used as input to the transformation using the WEBROUTINE XSL stylesheets to produce the final presentation output. The format of the XML document must be well known and standard to enable correct transformation into different and distinct presentation formats.

The XML document is divided into the following sections:

Context Section

The context section in the XML document contains contextual information about the WEBROUTINE. Items such as WAM name, WEBROUTINE name, WEBROUTINE title are available here.

Options Section

The options section contains various options that may be modified for a WEBROUTINE that may determine whether particular validation or presentation functionality is enabled or not.

Messages Section

The messages section contains messages output using the MESSAGE RDML command at runtime.

Fields Section

The fields section contains fields that appear as outgoing fields in WEB_MAP statements in the WEBROUTINE. At runtime, the outgoing field values are added to this section to be transformed into the presentation output. Also captions, descriptions and headings of those fields are added to this section both at runtime and design time.

Lists Section

The lists section contains lists that appear as outgoing lists in WEB_MAP statements in the WEBROUTINE. Headings for each of the field columns and field values for each of the list rows for each of the lists are added to this section at runtime. Headings, but not actual runtime row values, are also available in this section at design time. Generated lists have an attribute inline="true" if they are inlined. JSON lists are sent as CDATA sections. JSON lists are normally consumed by JavaScript.

XML Document Example

The following is an example of the XML document:

 

<?xml version="1.0" encoding="UTF-8"?>
 <!-- Web application : SAMPLEWAM       Test

      Webroutine      : EmployeeEntry   Add an Employee

      Timestamp       : 2011-08-26T16:45:00 -->
 <lxml:data xmlns:lxml="http://www.lansa.com/2002/XML/Runtime-Data">
    <lxml:context>
         <lxml:user-id>PCXUSER</lxml:user-id>
         <lxml:webapplication>SAMPLEWAM</lxml:webapplication>
         <lxml:webapplication-title>Test</lxml:webapplication-title>
         <lxml:webroutine>EmployeeEntry</lxml:webroutine>
         <lxml:webroutine-title>Add an Employee</lxml:webroutine-title>
         <lxml:service-name>SAMPLEWAM_EmployeeEntry</lxml:service-name>
         <lxml:partition>DEM</lxml:partition>
         <lxml:language iso-lang="en">ENG</lxml:language>
         <lxml:images-path>/IMAGES</lxml:images-path>
         <lxml:action-request>/CGI-BIN/lansaweb</lxml:action-request>
      </lxml:context>
      <lxml:options>
         <lxml:option name="DBCS">false</lxml:option>
         <lxml:option name="align-right">true</lxml:option>
         <lxml:option name="check-numeric">true</lxml:option>
         <lxml:option name="debug" />
         <lxml:option name="trace" />
         <lxml:option name="task" />
      </lxml:options>
      <lxml:external-resources>

         <lxml:script name="XWJQC" charset="utf-8" location="header">jquery/1.9.1/jquery.min.js</lxml:script>

         <lxml:script name="XWJQUI" charset="iso-8859-1" location="header">jquery-ui/1.10.3/js/jquery-ui.all.min.js</lxml:script>

         <lxml:script name="XWJ001" charset="utf-8" location="header">script/std_jqueryui.min.js</lxml:script>

         <lxml:script name="XWJ003" charset="utf-8" location="header">script/std_json.min.js</lxml:script>

         <lxml:style name="XWC001" charset="utf-8" location="header">style/jquery/std_jqueryui.min.css</lxml:style>

         <lxml:style name="XWT01J" charset="iso-8859-1" location="header">jquery-ui/1.10.3/css/redmond/jquery-ui.all.min.css</lxml:style>

         <lxml:style name="XWT01L101" charset="utf-8" location="header">style/jquery/redmond/std_themelet1_style1.min.css</lxml:style>

      </lxml:external-resources>

      <lxml:messages />
      <lxml:fields>
         <lxml:field name="SURNAME">
            <lxml:caption>
               <lxml:label>Surname........</lxml:label>
               <lxml:description>Employee Surname</lxml:description>
               <lxml:heading-1>Surname</lxml:heading-1>
               <lxml:heading-2 />
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="GIVENAME">
            <lxml:caption>
               <lxml:label>Given names....</lxml:label>
               <lxml:description>Employee Given Name(s)</lxml:description>
               <lxml:heading-1>Given name(s)</lxml:heading-1>
               <lxml:heading-2 />
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="EMPNO">
            <lxml:caption>
               <lxml:label>Employee no....</lxml:label>
               <lxml:description>Employee Number</lxml:description>
               <lxml:heading-1>  Employ</lxml:heading-1>
               <lxml:heading-2>  Number</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="ADDRESS1">
            <lxml:caption>
               <lxml:label>Address 1......</lxml:label>
               <lxml:description>Street No and Name</lxml:description>
               <lxml:heading-1>Address line 1</lxml:heading-1>
               <lxml:heading-2 />
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="ADDRESS2">
            <lxml:caption>
               <lxml:label>Address 2......</lxml:label>
               <lxml:description>Suburb or Town</lxml:description>
               <lxml:heading-1>Address line 2</lxml:heading-1>
               <lxml:heading-2 />
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="ADDRESS3">
            <lxml:caption>
               <lxml:label>Country</lxml:label>
               <lxml:description>State and Country</lxml:description>
               <lxml:heading-1>Country</lxml:heading-1>
               <lxml:heading-2 />
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="POSTCODE">
            <lxml:caption>
               <lxml:label>Post/zip code..</lxml:label>
               <lxml:description>Post / Zip Code</lxml:description>
               <lxml:heading-1>Post/zip</lxml:heading-1>
               <lxml:heading-2>Code</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="PHONEHME">
            <lxml:caption>
               <lxml:label>Home phone.....</lxml:label>
               <lxml:description>Home Phone Number</lxml:description>
               <lxml:heading-1>Home phone</lxml:heading-1>
               <lxml:heading-2>Number</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="PHONEBUS">
            <lxml:caption>
               <lxml:label>Business ph....</lxml:label>
               <lxml:description>Business Phone Number</lxml:description>
               <lxml:heading-1>Business Phone</lxml:heading-1>
               <lxml:heading-2>Number</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="STARTDTER">
            <lxml:caption>
               <lxml:label>Start date.....</lxml:label>
               <lxml:description>Start date (YYMMDD)</lxml:description>
               <lxml:heading-1>Start</lxml:heading-1>
               <lxml:heading-2>Date</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="TERMDATER">
            <lxml:caption>
               <lxml:label>Term. date.....</lxml:label>
               <lxml:description>Termination Date (YYMMDD)</lxml:description>
               <lxml:heading-1>Term.</lxml:heading-1>
               <lxml:heading-2>Date</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="DEPTMENT">
            <lxml:caption>
               <lxml:label>Department.....</lxml:label>
               <lxml:description>Department Code</lxml:description>
               <lxml:heading-1>  Dept</lxml:heading-1>
               <lxml:heading-2>  Code</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="SECTION">
            <lxml:caption>
               <lxml:label>Section........</lxml:label>
               <lxml:description>Section Code</lxml:description>
               <lxml:heading-1>    Section</lxml:heading-1>
               <lxml:heading-2>     Code</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="SALARY">
            <lxml:caption>
               <lxml:label>Salary.........</lxml:label>
               <lxml:description>Employee Salary</lxml:description>
               <lxml:heading-1>Salary</lxml:heading-1>
               <lxml:heading-2 />
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="MNTHSAL">
            <lxml:caption>
               <lxml:label>Monthly Salary</lxml:label>
               <lxml:description>Monthly Salary</lxml:description>
               <lxml:heading-1>Monthly</lxml:heading-1>
               <lxml:heading-2>Salary</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="STARTDTE">
            <lxml:caption>
               <lxml:label>Start date.....</lxml:label>
               <lxml:description>Start Date (DDMMYY)</lxml:description>
               <lxml:heading-1>Start</lxml:heading-1>
               <lxml:heading-2>Date</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
         <lxml:field name="TERMDATE">
            <lxml:caption>
               <lxml:label>Term. date.....</lxml:label>
               <lxml:description>Termination Date (DDMMYY)</lxml:description>
               <lxml:heading-1>Term.</lxml:heading-1>
               <lxml:heading-2>Date</lxml:heading-2>
               <lxml:heading-3 />
            </lxml:caption>
            <lxml:value />
         </lxml:field>
      </lxml:fields>
      <lxml:lists>
         <lxml:list name="DEPTLIST" row-count="5">
            <lxml:list-header>
               <lxml:header name="DEPTMENT">
                  <lxml:heading-1>  Dept</lxml:heading-1>
                  <lxml:heading-2>  Code</lxml:heading-2>
                  <lxml:heading-3 />
               </lxml:header>
               <lxml:header name="DEPTDESC">
                  <lxml:heading-1>Department</lxml:heading-1>
                  <lxml:heading-2>Description</lxml:heading-2>
                  <lxml:heading-3 />
               </lxml:header>
            </lxml:list-header>
            <lxml:list-entries>
               <lxml:entry>
                  <lxml:column name="DEPTMENT" id="DEPTLIST.0001.DEPTMENT" />
                  <lxml:column name="DEPTDESC" id="DEPTLIST.0001.DEPTDESC">Value DEPTDESC 1</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="DEPTMENT" id="DEPTLIST.0002.DEPTMENT" />
                  <lxml:column name="DEPTDESC" id="DEPTLIST.0002.DEPTDESC">Value DEPTDESC 2</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="DEPTMENT" id="DEPTLIST.0003.DEPTMENT" />
                  <lxml:column name="DEPTDESC" id="DEPTLIST.0003.DEPTDESC">Value DEPTDESC 3</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="DEPTMENT" id="DEPTLIST.0004.DEPTMENT" />
                  <lxml:column name="DEPTDESC" id="DEPTLIST.0004.DEPTDESC">Value DEPTDESC 4</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="DEPTMENT" id="DEPTLIST.0005.DEPTMENT" />
                  <lxml:column name="DEPTDESC" id="DEPTLIST.0005.DEPTDESC">Value DEPTDESC 5</lxml:column>
               </lxml:entry>
            </lxml:list-entries>
         </lxml:list>
         <lxml:list name="SECTLIST" row-count="5">
            <lxml:list-header>
               <lxml:header name="SECTION">
                  <lxml:heading-1>    Section</lxml:heading-1>
                  <lxml:heading-2>     Code</lxml:heading-2>
                  <lxml:heading-3 />
               </lxml:header>
               <lxml:header name="SECDESC">
                  <lxml:heading-1>Section</lxml:heading-1>
                  <lxml:heading-2>Description</lxml:heading-2>
                  <lxml:heading-3 />
               </lxml:header>
            </lxml:list-header>
            <lxml:list-entries>
               <lxml:entry>
                  <lxml:column name="SECTION" id="SECTLIST.0001.SECTION" />
                  <lxml:column name="SECDESC" id="SECTLIST.0001.SECDESC">Value SECDESC 1</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="SECTION" id="SECTLIST.0002.SECTION" />
                  <lxml:column name="SECDESC" id="SECTLIST.0002.SECDESC">Value SECDESC 2</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="SECTION" id="SECTLIST.0003.SECTION" />
                  <lxml:column name="SECDESC" id="SECTLIST.0003.SECDESC">Value SECDESC 3</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="SECTION" id="SECTLIST.0004.SECTION" />
                  <lxml:column name="SECDESC" id="SECTLIST.0004.SECDESC">Value SECDESC 4</lxml:column>
               </lxml:entry>
               <lxml:entry>
                  <lxml:column name="SECTION" id="SECTLIST.0005.SECTION" />
                  <lxml:column name="SECDESC" id="SECTLIST.0005.SECDESC">Value SECDESC 5</lxml:column>
               </lxml:entry>
            </lxml:list-entries>
         </lxml:list>
         <lxml:json-list name="LIST01"><![CDATA[{"list":{
            "LIST01":{"header":[
               {"name":"DEPTMENT","heading-2":" Dept","heading-3":"Code"},
               {"name":"DEPTDESC","heading-2":"Department","heading-3":"Description"},
               {"name":"PCK105","heading-1":"Packed","heading-2":"(10,","heading-3":"5)"},
               {"name":"DAT01","heading-2":"Date","heading-3":"field"},
               {"name":"BOOL1","heading-2":"Boolean","heading-3":"Field"},
               {"name":"FLT01","heading-2":"Float","heading-3":"field"},
               {"name":"FLT04","heading-2":"Float","heading-3":"4"},
               {"name":"INT01","heading-1":"Integer","heading-2":"field","heading-3":"1"},
               {"name":"INT02","heading-1":"Integer","heading-2":"field","heading-3":"2"}],
               "entries":[
                 ["ADM","Admin > Dept",23456.78900,"2011-08-29",true,+1.234567000000000E+004,+1.234567E+004,12345,12345],
                 ["SD","Sales\" & Dist",65432.12340,"2011-08-29",false,+1.234567000000000E+004,+1.234567E+004,12345,12345]
               ]}}}
         ]]>
         </lxml:json-list>
      </lxml:lists>