Sample Schema and XML Instance Files

The following examples show how to configure the search appliance. Configuration of the search appliance includes adding the iEI listener to the crawl list, verifying feeds, and customizing search results.

Note (PDF and Online Only): Each of the following files is accompanied by an attached file that contains the text of the script. To view a script in an external editor, double-click the icon corresponding to the script you would like to view, then select Open this file. To save the attached file, right-click the icon, select Save Embedded File to Disk, and change the file extension to .xscl. This option is not available in printed copies of this manual.


Top of page

Example: Creating a Schema File

The following is a sample schema file.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified">
   <xs:element name="db">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="users"/>
            <xs:element ref="groups"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="group">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="selection" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:attribute name="name" use="required" type="xs:string"/>
      </xs:complexType>
   </xs:element>
   <xs:element name="groups">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="group" maxOccurs="unbounded"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="selection">
      <xs:complexType>
         <xs:attribute name="type" type="xs:string" use="required"/>
         <xs:attribute name="parm" use="required" type="xs:string"/>
         <xs:attribute name="xform" use="required" type="xs:string"/>
         <xs:attribute name="xformtype" use="required">
            <xs:simpleType>
               <xs:restriction base="xs:NMTOKEN">
                  <xs:enumeration value="iway"/>
                  <xs:enumeration value="xslt"/>
               </xs:restriction>
            </xs:simpleType>
         </xs:attribute>
         <xs:attribute name="output" use="required">
            <xs:simpleType>
               <xs:restriction base="xs:NMTOKEN">
                  <xs:enumeration value="flat"/>
                  <xs:enumeration value="xml"/>
               </xs:restriction>
            </xs:simpleType>
         </xs:attribute>
      </xs:complexType>
   </xs:element>
   <xs:element name="user">
      <xs:complexType>
         <xs:sequence><xs:element ref="group" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:attribute name="name" use="required" type="xs:string"/>
         <xs:attribute name="password" type="xs:string" use="required"/>
      </xs:complexType>
   </xs:element>
   <xs:element name="users">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="user" maxOccurs="unbounded"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

Top of page

Example: Creating an Authorization Database XML File

In the following sample code there are three users, each of whom belongs to a different group with different permissions for two documents. The "judges" group has permission to view two different documents, both of which are XML. Users in this group can see warrant and rapsheet documents. However, in both cases, a transformation is applied before the document is returned to the user. Since these transformations (an iWay transformation for the warrant document and an XSLT template for the rapsheet) output HTML instead of XML, output is set to "flat" in both cases.

<?xml version="1.0" encoding="UTF-8"?>
<db>
  <users>
    <user name="steve" password="password">
    <group name="judges"/>
    </user>
   <user name="dick" password="password">
    <group name="cops"/>
    <group name="lawenforcement"/>
    </user>
    <user name="admin" password="password">
    <group name="administrators"/>
    </user>
  </users>
  <groups>
    <group name="judges">
      <selection type="XML" parm="warrant" xform="warrant_judgeview" 
xformtype="iway" output="flat"/>
      <selection type="XML" parm="rapsheet" xform="rapsheet_judgeview" 
xformtype="xslt" output="flat"/>
    </group>
    <group name="cops">
      <selection type="XML" parm="warrant" xform="warrant_copview" 
xformtype="iway" output="flat"/>
      <selection type="XML" parm="rapsheet" xform="rapsheet_copview" 
xformtype="xslt" output="flat"/>
    </group>
    <group name="administrators">
       <!-- administrators get full, untransformed view of any document 
they request -->
    </group>
    </groups>
</db>

iWay Software