Scroll

Askiadesign XML

Follow

Askia surveys can be designed with XML. The XSD (that is the XML file that defines the Askia XML file) is a work in progress. But we have attached it here so you can validate your document before you try to create an Askia survey.
There is also a documentation of this XML document automatically generated from the xsd using x3sp.
And we also have attached a standard export of the Ex.qes demo survey into XML.

XSD

<?xml version="1.0" encoding="utf-16"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" />
  <xs:simpleType name="ElementType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="question"/>
      <xs:enumeration value="loop"/>
      <xs:enumeration value="chapter"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="QuestionType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="closed"/>
      <xs:enumeration value="numeric"/>
      <xs:enumeration value="date" />
      <xs:enumeration value="open" />
      <xs:enumeration value="table" />
      <xs:enumeration value="iteration" />
      <xs:enumeration value="preliminary" />
      <xs:enumeration value="counter" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="Survey">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Languages">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="Language" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Questions">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="Question">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ErrorMessages">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="ErrorMessage">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ScreenGroups">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="ScreenGroup">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Resources">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="Resource">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element ref="InternetOptions" />
      </xs:sequence>
      <xs:attribute name="Version" type="xs:decimal" use="required" />
      <xs:attribute name="Full" type="xs:unsignedByte" use="required" />
      <xs:attribute name="MaxQuestionID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="MaxResponseID" type="xs:unsignedByte" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="Question">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="LongCaption">
          <xs:complexType mixed="true">
            <xs:sequence minOccurs="0">
              <xs:element name="text">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute ref="xml:lang" use="required" />
                      <xs:attribute name="Lid" type="xs:unsignedShort" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" name="ShortCaption">
          <xs:complexType mixed="true">
              <xs:sequence minOccurs="0">
                <xs:element name="text">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute ref="xml:lang" use="required" />
                        <xs:attribute name="Lid" type="xs:unsignedShort" use="required" />
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
          </xs:complexType>
        </xs:element>
      <xs:element name="Importation" minOccurs="0">
        <xs:complexType>
          <xs:attribute name="Type" type="xs:unsignedByte" use="required" />
          <xs:attribute name="Closed" type="xs:unsignedByte" use="required" />
          <xs:attribute name="Parameter" type="xs:string" use="required" />
          <xs:attribute name="DB" type="xs:string" use="required" />
          <xs:attribute name="Invisible" type="xs:unsignedByte" use="required" />
        </xs:complexType>
      </xs:element >
      <xs:element minOccurs="0" name="Modalities">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="Modality">
              </xs:element>
            </xs:sequence>
            <xs:attribute name="RotationType" type="xs:unsignedByte" use="optional" />
            <xs:attribute name="LinkType" type="xs:unsignedByte" use="optional" />
            <xs:attribute name="LinkSource" type="xs:unsignedByte" use="optional" />
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" name="Routings">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="Routing">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" name="Questions">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="Question">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Shortcut" type="xs:string" use="required" />
      <xs:attribute name="Order" type="xs:unsignedLong" use="required" />
      <xs:attribute name="ElementType" type="ElementType" use="required" />
      <xs:attribute name="AllowDK" type="xs:boolean" use="optional" default="0" />
      <xs:attribute name="QuestionType" type="QuestionType" use="optional" />
      <xs:attribute name="Min" type="xs:decimal" use="optional" />
      <xs:attribute name="Max" type="xs:decimal" use="optional" />
      <xs:attribute name="Decimals" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="MaxResponse" type="xs:unsignedLong" use="optional" />
      <xs:attribute name="MinResponse" type="xs:unsignedLong" use="optional" default="0" />
      <xs:attribute name="MaxChars" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="UseAsArray" type="xs:boolean" use="optional" default="0" />
      <xs:attribute name="Pause" type="xs:boolean" use="optional" default="1" />
      <xs:attribute name="DateType" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="RotationType" type="xs:unsignedByte" use="optional"  />
      <xs:attribute name="Visible" type="xs:boolean" use="optional" default="1"/>
      <xs:attribute name="Translated" type="xs:boolean" use="optional" default="1"/>
      <xs:attribute name="Quota" type="xs:boolean" use="optional" default="0"/>
      <xs:attribute name="Versions" type="xs:string" use="optional" />
    </xs:complexType>
  </xs:element>
  <xs:element name="Routing">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Condition">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="ConditionType" type="xs:unsignedShort" use="required" />
                <xs:attribute name="Responses" type="xs:string" use="optional" />
                <xs:attribute name="Value1" type="xs:decimal" use="optional" />
                <xs:attribute name="Value2" type="xs:decimal" use="optional" />
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
         <xs:element name="Message" minOccurs="0">
          <xs:complexType mixed="true">
            <xs:sequence minOccurs="0">
              <xs:element name="text">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute ref="xml:lang" use="required" />
                      <xs:attribute name="Lid" type="xs:unsignedShort" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Ignored" minOccurs="0" />
        <xs:element name="IfTrue" type="xs:string" minOccurs="0" />
        <xs:element name="IfFalse" type="xs:string" minOccurs="0" />
        <xs:element name="QuestionOrder" type="xs:string" minOccurs="0" />
        <xs:element name="DB" type="xs:string" minOccurs="0" />
        <xs:element name="Query" type="xs:string" minOccurs="0" />
        <xs:element name="Program" type="xs:string" minOccurs="0" />
        <xs:element name="Parameters" type="xs:string" minOccurs="0" />
        <xs:element name="EmailInfo" type="xs:string" minOccurs="0" />
        <xs:element name="Recording" type="xs:string" minOccurs="0" />
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Type" type="xs:unsignedByte" use="required" />
      <xs:attribute name="TargetQuestion" type="xs:unsignedByte"  />
      <xs:attribute name="LanguageID" type="xs:unsignedShort"  />
      <xs:attribute name="Primary" type="xs:unsignedShort"  />
      <xs:attribute name="Secondary" type="xs:unsignedShort"  />
      <xs:attribute name="Blocking" type="xs:unsignedByte"  />
      <xs:attribute name="VersionId" type="xs:unsignedByte"  />
      <xs:attribute name="Charset" type="xs:unsignedByte"  />
      <xs:attribute name="Before" type="xs:boolean" default="0" />
      <xs:attribute name="After" type="xs:boolean" default="1" />
      <xs:attribute name="During" type="xs:boolean" default="0" />
      <xs:attribute name="WhenSkipped" type="xs:boolean" default="0" />
      <xs:attribute name="Versions" type="xs:string" use="optional" />
    </xs:complexType>
  </xs:element>
  <xs:element name="Modality">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="ShortCaption">
          <xs:complexType mixed="true">
            <xs:sequence minOccurs="0">
              <xs:element name="text">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute ref="xml:lang" use="required" />
                      <xs:attribute name="Lid" type="xs:unsignedShort" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Behaviour" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="Exclusive" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="Factor" type="xs:decimal" use="optional" />
    </xs:complexType>
  </xs:element>
  <xs:element name="Resource">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="InControl" />
        <xs:element name="Params" />
        <xs:element name="Mime" />
        <xs:element name="Path" type="xs:string" />
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Name" type="xs:string" use="required" />
      <xs:attribute name="Type" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Code" type="xs:unsignedByte" use="required" />
      <xs:attribute name="LanguageID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Checksum" type="xs:unsignedInt" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="InternetOptions">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Buttons">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="PrevBmp" type="xs:string" />
              <xs:element name="NextBmp" type="xs:string" />
              <xs:element name="Between" type="xs:string" />
              <xs:element name="PrevProp" type="xs:string" />
              <xs:element name="NextProp" type="xs:string" />
              <xs:element name="Before" type="xs:string" />
              <xs:element name="After" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="OffsetY" type="xs:unsignedByte" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="Page">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Header" type="xs:string" />
              <xs:element name="Body" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="Layout" type="xs:unsignedByte" use="required" />
            <xs:attribute name="MargY" type="xs:unsignedByte" use="required" />
            <xs:attribute name="GenWidth" type="xs:unsignedByte" use="required" />
            <xs:attribute name="HtmlType" type="xs:unsignedByte" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="Errors">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Before" type="xs:string" />
              <xs:element name="After" type="xs:string" />
              <xs:element name="CtrlAfter" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="Display" type="xs:unsignedByte" use="required" />
            <xs:attribute name="PShift" type="xs:unsignedByte" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="Table">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="HdrColTd" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="HdrCol" type="xs:unsignedByte" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="JavaScript">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="LivePath" type="xs:string" />
              <xs:element name="TestPath" type="xs:string" />
              <xs:element name="RestTestPath" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="FlyVal" type="xs:unsignedByte" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="Exit">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Final" type="xs:string" />
              <xs:element name="Offline" type="xs:string" />
              <xs:element name="Completed" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Name" type="xs:string" use="required" />
      <xs:attribute name="StoreQuota" type="xs:unsignedByte" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="ScreenGroup">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Template" type="xs:string" />
        <xs:element name="Screen" type="xs:string" />
        <xs:element name="Question" type="xs:string" />
        <xs:element name="Chapter" type="xs:string" />
        <xs:element name="Response" type="xs:string" />
        <xs:element name="Open" type="xs:string" />
        <xs:element name="Numeric" type="xs:string" />
        <xs:element name="Label" type="xs:string" />
        <xs:element name="List" type="xs:string" />
        <xs:element name="Item" type="xs:string" />
        <xs:element name="Blocks" type="xs:string" />
        <xs:element name="Button" type="xs:string" />
        <xs:element name="Screens">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="Screen">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Name" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="Screen">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Controls">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" ref="Control">
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Name" type="xs:string" use="required" />
      <xs:attribute name="BackCol" type="xs:unsignedInt" use="required" />
      <xs:attribute name="ForeCol" type="xs:unsignedInt" use="required" />
      <xs:attribute name="MaxForms" type="xs:byte" use="required" />
    </xs:complexType>
  </xs:element>
  <xs:element name="Control">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" name="Cell" type="xs:string" />
        <xs:element minOccurs="0" name="Block" type="xs:string" />
        <xs:element name="Font">
          <xs:complexType>
            <xs:attribute name="Face" type="xs:string" use="required" />
            <xs:attribute name="H" type="xs:unsignedByte" use="required" />
            <xs:attribute name="B" type="xs:unsignedByte" use="optional" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="ID" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Question" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Type" type="xs:unsignedByte" use="required" />
      <xs:attribute name="BackCol" type="xs:unsignedInt" use="optional" />
      <xs:attribute name="ForeCol" type="xs:unsignedInt" use="optional" />
      <xs:attribute name="Trans" type="xs:unsignedByte" use="required" />
      <xs:attribute name="X" type="xs:unsignedShort" use="required" />
      <xs:attribute name="Y" type="xs:unsignedShort" use="required" />
      <xs:attribute name="W" type="xs:unsignedShort" use="required" />
      <xs:attribute name="H" type="xs:unsignedShort" use="required" />
      <xs:attribute name="CtrlH" type="xs:unsignedByte" use="required" />
      <xs:attribute name="Error" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="GenFont" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="CtrlW" type="xs:unsignedByte" use="optional" />
      <xs:attribute name="Response" type="xs:byte" use="optional" />
    </xs:complexType>
  </xs:element>
  <xs:element name="ErrorMessage">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="ID" type="xs:unsignedInt" use="required" />
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="Language"  >
    <xs:complexType>
      <xs:attribute name="ID" type="xs:unsignedShort" use="required" />
      <xs:attribute name="Abbr" type="xs:string" use="required" />
      <xs:attribute name="Name" type="xs:string" use="required" />
      <xs:attribute name="Default" type="xs:unsignedByte" use="optional" />
    </xs:complexType>
  </xs:element>
</xs:schema>

XML

Download the attached Ex.xml file to view.

Have more questions? Submit a request

Comments