Duncan Temple Lang

University of California at Davis

Department of Statistics


This is a retrospective and somewhat scattered, incomplete description of what goes on in the XMLSchema package. This is mixed a little with the SSOAP package and how this uses the XMLSchema package. This is partly because the two packages were originally tightly coupled and also because the SSOAP package is the main package that uses XMLSchema.

Within a schema, we have <element>, <complexType>, <simpleType>, <group> <annotation> <attributeGroup> and possibly <comment>.

sequence

In cuahsi_1_0.asmx.wsdl, the third element in the schema is GetSitesXmlResponse. This is defined as

      <s:element name="GetSitesXmlResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="GetSitesXmlResult" type="s:string"/>
          </s:sequence>
        </s:complexType>
      </s:element>

This means that we will end up with XML nodes in documents of the form

 <GetSitesXmlResponse><GetSitesXmlResult>value</GetSitesXmlResult></GetSitesXmlResponse>

<q>Will this be within a <GetSitesXmlResponse> element or within another element that is defined.</q> This maps to an Element object in R. When defining the classes for the schema, we turn this into a new class named GetSitesXmlResponse. This complex type has a single element which is a sequence and contains either 0 or 1 instance of a GetSitesXmlResult The definition in this case should be

setClassUnion("GetSitesXmlResponse", c("NULL", "GetSitesXmlResult"))