<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:liberty:is:2006-08"
           xmlns="urn:liberty:is:2006-08"
           xmlns:lu="urn:liberty:util:2006-08"
           xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified"
           version="2.0">

  <xs:import namespace="urn:liberty:util:2006-08"
             schemaLocation="liberty-idwsf-utility-v2.0.xsd"/>

  <xs:import namespace="http://schemas.xmlsoap.org/soap/envelope/"
             schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/>
  <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
             schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>

  <xs:annotation>
    <xs:documentation>
      The source code in this schema file was excerpted verbatim from:

      Liberty ID-WSF Interaction Service Specification
      Version 2.0-errata-v1.0
      21 April, 2007

      Copyright (c) 2007 Liberty Alliance participants, see
      http://projectliberty.org/resource_center/specifications/liberty_alliance_id_wsf_2_0_specifications/idwsf_feb_copyrights

    </xs:documentation>
  </xs:annotation>

  <xs:element name="InteractionRequest" type="InteractionRequestType"/>
  <xs:complexType name="InteractionRequestType">
    <xs:sequence>
      <xs:element ref="Inquiry" maxOccurs="unbounded"/>
      <xs:element ref="ds:KeyInfo" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="optional"/>
    <xs:attribute name="language" type="xs:NMTOKENS" use="optional"/>
    <xs:attribute name="maxInteractTime" type="xs:integer" use="optional"/>
    <xs:attribute name="signed" type="xs:token" use="optional"/>
  </xs:complexType>

  <xs:element name="Inquiry" type="InquiryType"/>
  <xs:complexType name="InquiryType">
    <xs:sequence>
      <xs:element ref="Help" minOccurs="0"/>
      <xs:choice maxOccurs="unbounded">
        <xs:element ref="Select" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="Confirm" type="InquiryElementType"
                    minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="Text" minOccurs="0" maxOccurs="unbounded"/>
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="id" type="xs:ID" use="optional"/>
    <xs:attribute name="title" type="xs:string" use="optional"/>
  </xs:complexType>

  <xs:element name="Help" type="HelpType"/>
  <xs:complexType name="HelpType">
    <xs:attribute name="label" type="xs:string" use="optional"/>
    <xs:attribute name="link" type="xs:anyURI" use="optional"/>
    <xs:attribute name="moreLink" type="xs:anyURI" use="optional"/>
  </xs:complexType>

  <xs:element name="Hint" type="xs:string"/>

  <xs:element name="Select" type="SelectType"/>
  <xs:complexType name="SelectType">
    <xs:complexContent>
      <xs:extension base="InquiryElementType">
        <xs:sequence>
          <xs:element name="Item" minOccurs="2" maxOccurs="unbounded">
            <xs:complexType>
              <xs:sequence>
                <xs:element ref="Hint" minOccurs="0"/>
              </xs:sequence>
              <xs:attribute name="label" type="xs:string" use="optional"/>
              <xs:attribute name="value" type="xs:NMTOKEN" use="required"/>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="multiple" type="xs:boolean" use="optional" default="false"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="Text" type="TextType"/>
  <xs:complexType name="TextType">
    <xs:complexContent>
      <xs:extension base="InquiryElementType">
        <xs:attribute name="minChars" type="xs:integer" use="optional"/>
        <xs:attribute name="maxChars" type="xs:integer" use="optional"/>
        <xs:attribute name="format" type="xs:string" use="optional"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="InquiryElementType" abstract="true">
    <xs:sequence>
      <xs:element ref="Help" minOccurs="0"/>
      <xs:element ref="Hint" minOccurs="0"/>
      <xs:element name="Label" type="xs:normalizedString" minOccurs="0"/>
      <xs:element name="Value" type="xs:normalizedString" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:ID" use="required"/>
  </xs:complexType>

  <xs:element name="InteractionResponse" type="InteractionResponseType"/>
  <xs:complexType name="InteractionResponseType">
    <xs:sequence>
      <xs:element ref="lu:Status"/>
      <xs:choice>
        <xs:element name="InteractionStatement" type="InteractionStatementType"
                    minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="Parameter" type="ParameterType" minOccurs="0"
                    maxOccurs="unbounded"/>
      </xs:choice>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="InteractionStatementType">
    <xs:sequence>
      <xs:element ref="Inquiry" maxOccurs="unbounded"/>
      <xs:element ref="ds:Signature"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ParameterType">
    <xs:attribute name="name" type="xs:ID" use="required"/>
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>

</xs:schema> 
