Differences between structured and grouped XML

In wwwopac.ashx, the structured xmltype (as could be used globally with wwwopac.exe) has only been implemented for saved searches (aka pointer files). If you do use it with other functionality, the result will be unstructured XML, regardless of what the diagnostics may indicate. If you are migrating from a wwwopac.exe application using the structured xmltype, to a wwwopac.ashx application using the grouped xmltype, the differences may be relevant to your application.

First an example of structured wwwopac.exe output:

<?xml version="1.0" encoding="UTF-8" ?>
<adlibXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="http://www.adlibsoft.com/adlibXML.xsd">
  <recordList>
    <record>
      <priref>1234</priref>
      <object.number>B2389</object.number>
      <title>
        <title>Flower pot with two handles</title>
      </title>
      <maker>
        <maker linkref="33" linkfield="name" linkreffield="l1" linkdb="C:\Adlib\data\../data+people">
          <name>Verlaan, Rob</name>
        </maker>
        <maker.role linkref="3770" linkfield="term" linkreffield="lR" linkdb="C:\Adlib\data\../data+thesau">
          <term>potter</term>
        </maker.role>
      </maker>
      <object_name>
        <object.name linkref="165" linkfield="term" linkreffield="l3" linkdb="C:\Adlib\data\../data+thesau">
          <term>flower pot</term>
        </object.name>
      </object_name>
      <object_name>
        <object.name linkref="2238" linkfield="term" linkreffield="l3" linkdb="C:\Adlib\data\../data+thesau">
          <term>pot</term>
        </object.name>
      </object_name>
      <documentation>
        <documentation.title linkref="83747" linkfield="title" linkreffield="dr" linkdb="C:\Adlib\data\../data+document">
          <year_of_publication>1977</year_of_publication>
          <copy.shelfmark>62 H 43</copy.shelfmark>
          <title>German pottery</title>
          <author>Hekkel, Herbert</author>
          <publisher>Pottery Museums United</publisher>
          <place>Amsterdam</place>
          <copy.number>1977/253</copy.number>
        </documentation.title>
      </documentation>      
    ...
    </record>
  </recordList>
  <diagnostic>
    <xmltype>STRUCTURED</xmltype>
    <hits>378</hits>
    ...
    <databasepath>c:\adlib\data</databasepath>
    <dbname>collect</dbname>
    <dsname>object</dsname>
    <cgistring url="?database=Collect&search=all&xmltype=structured">
      <param name="database">Collect</param>
      <param name="search">all</param>
      <param name="xmltype">structured</param>      
    </cgistring>
  </diagnostic>
</adlibXML>

Secondly an example of grouped wwwopac.ashx output:

<adlibXML>
  <recordList>
    <record priref="1234" selected="False">
      <documentation>
        <catalogue_number>cat.nr. 3</catalogue_number>
        <pagination.catalogue>p. 14-15</pagination.catalogue>
        <documentation.volume/>
        <documentation.year/>
        <documentation.publication.year>1977</documentation.publication.year>
        <documentation.issue/>
        <documentation.page_reference/>
        <documentation.shelfmark>62 H 43</documentation.shelfmark>
        <documentation.title>German pottery</documentation.title>
        <documentation.source.title/>
        <documentation.author>Hekkel, Herbert</documentation.author>
        <documentation.publisher>Pottery Museums United</documentation.publisher>
        <documentation.place>Amsterdam</documentation.place>
        <documentation.copy_number>1977/253</documentation.copy_number>
        <documentation.title.lref>83747</documentation.title.lref>
      </documentation>
      <maker>
        <maker>Verlaan, Rob</maker>
        <maker.name.lref>33</maker.name.lref>
        <maker.role>potter</maker.role>
        <maker.role.lref>3770</maker.role.lref>
        <maker.birth.date/>
        <maker.birth.date.end/>
        <maker.birth.date.precision/>
        <maker.birth.place/>
        ...
      </maker>
      <object_name>
        <object.name>flower pot</object.name>
        <object.name.lref>165</object.name.lref>
        <object.name.notes/>
        <object.name.type/>
      </object_name>
      <object_name>
        <object.name>pot</object.name>
        <object.name.lref>2238</object.name.lref>
        ...
      </object_name>
      <priref>1234</priref>
      <object.number>B2389</object.number>
      ...
      <title>
        <title>
          Flower pot with two handles
        </title>
      </title>
    </record>
  </recordList>
  <diagnostic>
    <hits>378</hits>
    <xmltype>Grouped</xmltype>
    ...
    <search>all</search>
    <dbname>collect</dbname>
    <dsname>object</dsname>
    <cgistring>
      <param name="database">Collect</param>
    </cgistring>
  </diagnostic>
</adlibXML>

The differences are:

  • In the grouped wwwopac.ashx output, the record priref has become an attribute of the <record> node, but appears as a separate node as well.
  • Up to and including wwwopac.ashx version 3.6.1173.0, if in the grouped wwwopac.ashx output an accessible field to be retrieved was part of a data dictionary field group, then all fields from the field group would be retrieved, even if they were empty. In later versions, only the available fields set in adlibweb.xml will be retrieved.
  • In the structured wwwopac.exe output, the names of the sub nodes of a linked field (like maker or object_name) are the names of the linked-to field and any merged-in fields from the linked database, while in the grouped wwwopac.ashx output, the names of the sub nodes of a linked field are the names of the linked field in the primary database and target fields for any merged-in fields. For example: in the structured output, the <name> node underneath <maker> refers to the linked-to name field in the linked database PEOPLE, while in the grouped output, the <name> sub node has been replaced with the <maker> sub node, which refers to the linked maker field in the primary database.
  • In the structured wwwopac.exe output, there existed the linkref, linkfield, linkreffield and linkdb attributes in a linked field node. In the grouped wwwopac.ashx output, these attributes are no longer present, but the linkreffield now has its own node next to the linked field, containing the actual linkref.
  • In the <diagnostics> section of grouped wwwopac.ashx output, the <databasepath> node is no longer present, and the query is no longer an attribute of the <cgistring> node but is now split up between a <search> and <cgistring> node.