<?xml version="1.0" encoding="utf-8" ?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
  <title>Validations for mapping</title>
  <pattern id="prohibitions">
    <rule context="StaffingOrder">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
      <assert test="empty(BillToAttention)">Element <name/> may not contain element BillToAttention</assert>
      <assert test="empty(PositionQuantityOpen)">Element <name/> may not contain element PositionQuantityOpen</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation">
      <assert test="empty(IntermediaryId)">Element <name/> may not contain element IntermediaryId</assert>
      <assert test="empty(BillToEntityId)">Element <name/> may not contain element BillToEntityId</assert>
      <assert test="empty(StaffingSupplierOrgUnitId)">Element <name/> may not contain element StaffingSupplierOrgUnitId</assert>
      <assert test="empty(TimeCardId)">Element <name/> may not contain element TimeCardId</assert>
      <assert test="empty(InvoiceId)">Element <name/> may not contain element InvoiceId</assert>
      <assert test="empty(PositionId)">Element <name/> may not contain element PositionId</assert>
      <assert test="empty(AssignmentId)">Element <name/> may not contain element AssignmentId</assert>
      <assert test="empty(HumanResourceId)">Element <name/> may not contain element HumanResourceId</assert>
      <assert test="empty(StaffingOrganizationId)">Element <name/> may not contain element StaffingOrganizationId</assert>
      <assert test="empty(UserArea)">Element <name/> may not contain element UserArea</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/MasterOrderId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/MasterOrderId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingCustomerId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingCustomerId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingCustomerOrgUnitId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingCustomerOrgUnitId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingSupplierId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingSupplierId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/CustomerReportingRequirements">
      <assert test="empty(ManagerName)">Element <name/> may not contain element ManagerName</assert>
      <assert test="empty(SupervisorName)">Element <name/> may not contain element SupervisorName</assert>
      <assert test="empty(ContactName)">Element <name/> may not contain element ContactName</assert>
      <assert test="empty(DepartmentName)">Element <name/> may not contain element DepartmentName</assert>
      <assert test="empty(LocationCode)">Element <name/> may not contain element LocationCode</assert>
      <assert test="empty(LocationName)">Element <name/> may not contain element LocationName</assert>
      <assert test="empty(CostCenterName)">Element <name/> may not contain element CostCenterName</assert>
      <assert test="empty(CustomerJobCode)">Element <name/> may not contain element CustomerJobCode</assert>
      <assert test="empty(CustomerJobDescription)">Element <name/> may not contain element CustomerJobDescription</assert>
      <assert test="empty(AccountCode)">Element <name/> may not contain element AccountCode</assert>
      <assert test="empty(ExternalOrderNumber)">Element <name/> may not contain element ExternalOrderNumber</assert>
      <assert test="empty(ExternalReqNumber)">Element <name/> may not contain element ExternalReqNumber</assert>
      <assert test="empty(Entity)">Element <name/> may not contain element Entity</assert>
      <assert test="empty(SubEntity)">Element <name/> may not contain element SubEntity</assert>
      <assert test="empty(Shift)">Element <name/> may not contain element Shift</assert>
      <assert test="empty(AdditionalRequirement)">Element <name/> may not contain element AdditionalRequirement</assert>
      <assert test="empty(PurchaseOrderLineItem)">Element <name/> may not contain element PurchaseOrderLineItem</assert>
    </rule>
    <rule context="StaffingOrder/OrderContact">
      <assert test="empty(@contactType)">Element <name/> may not have attribute contactType</assert>
    </rule>
    <rule context="StaffingOrder/OrderContact/ContactInfo">
      <assert test="empty(ContactId)">Element <name/> may not contain element ContactId</assert>
    </rule>
    <rule context="StaffingOrder/OrderContact/ContactInfo/PersonName">
      <assert test="empty(@script)">Element <name/> may not have attribute script</assert>
      <assert test="empty(FormattedName)">Element <name/> may not contain element FormattedName</assert>
      <assert test="empty(GivenName)">Element <name/> may not contain element GivenName</assert>
      <assert test="empty(PreferredGivenName)">Element <name/> may not contain element PreferredGivenName</assert>
      <assert test="empty(MiddleName)">Element <name/> may not contain element MiddleName</assert>
      <assert test="empty(FamilyName)">Element <name/> may not contain element FamilyName</assert>
      <assert test="empty(Affix)">Element <name/> may not contain element Affix</assert>
      <assert test="empty(AlternateScript)">Element <name/> may not contain element AlternateScript</assert>
    </rule>
    <rule context="StaffingOrder/OrderContact/ContactInfo/ContactMethod">
      <assert test="empty(Use)">Element <name/> may not contain element Use</assert>
      <assert test="empty(Location)">Element <name/> may not contain element Location</assert>
      <assert test="empty(WhenAvailable)">Element <name/> may not contain element WhenAvailable</assert>
      <assert test="empty(Pager)">Element <name/> may not contain element Pager</assert>
      <assert test="empty(TTYTDD)">Element <name/> may not contain element TTYTDD</assert>
      <assert test="empty(PostalAddress)">Element <name/> may not contain element PostalAddress</assert>
    </rule>
    <rule context="StaffingOrder/OrderContact/ContactInfo/ContactMethod/Mobile">
      <assert test="empty(@smsEnabled)">Element <name/> may not have attribute smsEnabled</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
      <assert test="empty(CustomerReportingRequirements)">Element <name/> may not contain element CustomerReportingRequirements</assert>
      <assert test="empty(DepartmentName)">Element <name/> may not contain element DepartmentName</assert>
      <assert test="empty(ReportToPerson)">Element <name/> may not contain element ReportToPerson</assert>
      <assert test="empty(PositionContact)">Element <name/> may not contain element PositionContact</assert>
      <assert test="empty(WorkSiteEnvironment)">Element <name/> may not contain element WorkSiteEnvironment</assert>
      <assert test="empty(PositionRequirements)">Element <name/> may not contain element PositionRequirements</assert>
      <assert test="empty(InvoiceInfo)">Element <name/> may not contain element InvoiceInfo</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
      <assert test="empty(PositionId)">Element <name/> may not contain element PositionId</assert>
      <assert test="empty(PositionStatus)">Element <name/> may not contain element PositionStatus</assert>
      <assert test="empty(ReportToPositionId)">Element <name/> may not contain element ReportToPositionId</assert>
      <assert test="empty(SpecialInstructions)">Element <name/> may not contain element SpecialInstructions</assert>
      <assert test="empty(TypeOfHours)">Element <name/> may not contain element TypeOfHours</assert>
      <assert test="empty(Quantity)">Element <name/> may not contain element Quantity</assert>
      <assert test="empty(PositionSpecificCondition)">Element <name/> may not contain element PositionSpecificCondition</assert>
      <assert test="empty(FormattedPositionDescription)">Element <name/> may not contain element FormattedPositionDescription</assert>
      <assert test="empty(JobCategory)">Element <name/> may not contain element JobCategory</assert>
      <assert test="empty(PositionMustEndByInfo)">Element <name/> may not contain element PositionMustEndByInfo</assert>
      <assert test="empty(TransitionInfo)">Element <name/> may not contain element TransitionInfo</assert>
      <assert test="empty(OvertimeInfo)">Element <name/> may not contain element OvertimeInfo</assert>
      <assert test="empty(HolidayWork)">Element <name/> may not contain element HolidayWork</assert>
      <assert test="empty(BusyPeriodInfo)">Element <name/> may not contain element BusyPeriodInfo</assert>
      <assert test="empty(LocalStaffingPositionInfo)">Element <name/> may not contain element LocalStaffingPositionInfo</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/JobId">
      <assert test="empty(Domain)">Element <name/> may not contain element Domain</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/RequestedPerson">
      <assert test="empty(@currentlyAssigned)">Element <name/> may not have attribute currentlyAssigned</assert>
      <assert test="empty(@mandatory)">Element <name/> may not have attribute mandatory</assert>
      <assert test="empty(Supplier)">Element <name/> may not contain element Supplier</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/RequestedPerson/PersonName">
      <assert test="empty(@script)">Element <name/> may not have attribute script</assert>
      <assert test="empty(LegalName)">Element <name/> may not contain element LegalName</assert>
      <assert test="empty(PreferredGivenName)">Element <name/> may not contain element PreferredGivenName</assert>
      <assert test="empty(MiddleName)">Element <name/> may not contain element MiddleName</assert>
      <assert test="empty(Affix)">Element <name/> may not contain element Affix</assert>
      <assert test="empty(AlternateScript)">Element <name/> may not contain element AlternateScript</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/RequestedPerson/PersonId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/RequestedPerson/PersonId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionDateRange">
      <assert test="empty(ActualEndDate)">Element <name/> may not contain element ActualEndDate</assert>
      <assert test="empty(MaxStartDate)">Element <name/> may not contain element MaxStartDate</assert>
      <assert test="empty(StartAsSoonAsPossible)">Element <name/> may not contain element StartAsSoonAsPossible</assert>
      <assert test="empty(MaxNeedEndDate)">Element <name/> may not contain element MaxNeedEndDate</assert>
      <assert test="empty(PositionDuration)">Element <name/> may not contain element PositionDuration</assert>
      <assert test="empty(ExtensionParameters)">Element <name/> may not contain element ExtensionParameters</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/Rates">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
      <assert test="empty(StaffingShiftId)">Element <name/> may not contain element StaffingShiftId</assert>
      <assert test="empty(Multiplier)">Element <name/> may not contain element Multiplier</assert>
      <assert test="empty(Description)">Element <name/> may not contain element Description</assert>
      <assert test="empty(RatesId)">Element <name/> may not contain element RatesId</assert>
      <assert test="empty(CustomerRateClassification)">Element <name/> may not contain element CustomerRateClassification</assert>
      <assert test="empty(BillingMultiplier)">Element <name/> may not contain element BillingMultiplier</assert>
      <assert test="empty(TimeWorkedRounding)">Element <name/> may not contain element TimeWorkedRounding</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/Rates/ExternalRateSetId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/WorkSite">
      <assert test="empty(WorkSiteId)">Element <name/> may not contain element WorkSiteId</assert>
      <assert test="empty(WorkSiteDetail)">Element <name/> may not contain element WorkSiteDetail</assert>
      <assert test="empty(TravelDirections)">Element <name/> may not contain element TravelDirections</assert>
      <assert test="empty(StructuredTravelDirections)">Element <name/> may not contain element StructuredTravelDirections</assert>
      <assert test="empty(ParkingInstructions)">Element <name/> may not contain element ParkingInstructions</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/WorkSite/PostalAddress">
      <assert test="empty(@type)">Element <name/> may not have attribute type</assert>
      <assert test="empty(Region)">Element <name/> may not contain element Region</assert>
      <assert test="empty(Recipient)">Element <name/> may not contain element Recipient</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/WorkSite/PostalAddress/DeliveryAddress">
      <assert test="empty(AddressLine)">Element <name/> may not contain element AddressLine</assert>
      <assert test="empty(PostOfficeBox)">Element <name/> may not contain element PostOfficeBox</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/StaffingShift">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
      <assert test="empty(Id)">Element <name/> may not contain element Id</assert>
      <assert test="empty(Name)">Element <name/> may not contain element Name</assert>
      <assert test="empty(StartTime)">Element <name/> may not contain element StartTime</assert>
      <assert test="empty(EndTime)">Element <name/> may not contain element EndTime</assert>
      <assert test="empty(TypeHours)">Element <name/> may not contain element TypeHours</assert>
      <assert test="empty(Comment)">Element <name/> may not contain element Comment</assert>
      <assert test="empty(ExternalStaffingShiftSetId)">Element <name/> may not contain element ExternalStaffingShiftSetId</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/OfferId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/PreviousOrderId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/PreviousOrderId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/RFQOrderId">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/RFQOrderId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume">
      <assert test="empty(ContactInfo)">Element <name/> may not contain element ContactInfo</assert>
      <assert test="empty(ExecutiveSummary)">Element <name/> may not contain element ExecutiveSummary</assert>
      <assert test="empty(Objective)">Element <name/> may not contain element Objective</assert>
      <assert test="empty(EmploymentHistory)">Element <name/> may not contain element EmploymentHistory</assert>
      <assert test="empty(MilitaryHistory)">Element <name/> may not contain element MilitaryHistory</assert>
      <assert test="empty(PatentHistory)">Element <name/> may not contain element PatentHistory</assert>
      <assert test="empty(PublicationHistory)">Element <name/> may not contain element PublicationHistory</assert>
      <assert test="empty(SpeakingEventsHistory)">Element <name/> may not contain element SpeakingEventsHistory</assert>
      <assert test="empty(Languages)">Element <name/> may not contain element Languages</assert>
      <assert test="empty(Achievements)">Element <name/> may not contain element Achievements</assert>
      <assert test="empty(Associations)">Element <name/> may not contain element Associations</assert>
      <assert test="empty(References)">Element <name/> may not contain element References</assert>
      <assert test="empty(SecurityCredentials)">Element <name/> may not contain element SecurityCredentials</assert>
      <assert test="empty(ResumeAdditionalItems)">Element <name/> may not contain element ResumeAdditionalItems</assert>
      <assert test="empty(SupportingMaterials)">Element <name/> may not contain element SupportingMaterials</assert>
      <assert test="empty(ProfessionalAssociations)">Element <name/> may not contain element ProfessionalAssociations</assert>
      <assert test="empty(Comments)">Element <name/> may not contain element Comments</assert>
      <assert test="empty(RevisionDate)">Element <name/> may not contain element RevisionDate</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory/SchoolOrInstitution">
      <assert test="empty(@schoolType)">Element <name/> may not have attribute schoolType</assert>
      <assert test="empty(SchoolName)">Element <name/> may not contain element SchoolName</assert>
      <assert test="empty(LocationSummary)">Element <name/> may not contain element LocationSummary</assert>
      <assert test="empty(PostalAddress)">Element <name/> may not contain element PostalAddress</assert>
      <assert test="empty(OrganizationUnit)">Element <name/> may not contain element OrganizationUnit</assert>
      <assert test="empty(Major)">Element <name/> may not contain element Major</assert>
      <assert test="empty(Minor)">Element <name/> may not contain element Minor</assert>
      <assert test="empty(Measure)">Element <name/> may not contain element Measure</assert>
      <assert test="empty(DatesOfAttendance)">Element <name/> may not contain element DatesOfAttendance</assert>
      <assert test="empty(Comments)">Element <name/> may not contain element Comments</assert>
      <assert test="empty(ISCEDInstitutionClassification)">Element <name/> may not contain element ISCEDInstitutionClassification</assert>
      <assert test="empty(UserArea)">Element <name/> may not contain element UserArea</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory/SchoolOrInstitution/School">
      <assert test="empty(InternetDomainName)">Element <name/> may not contain element InternetDomainName</assert>
      <assert test="empty(SchoolId)">Element <name/> may not contain element SchoolId</assert>
      <assert test="empty(SchoolName)">Element <name/> may not contain element SchoolName</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory/SchoolOrInstitution/Degree">
      <assert test="empty(@graduatingDegree)">Element <name/> may not have attribute graduatingDegree</assert>
      <assert test="empty(@examPassed)">Element <name/> may not have attribute examPassed</assert>
      <assert test="empty(DegreeName)">Element <name/> may not contain element DegreeName</assert>
      <assert test="empty(DegreeDate)">Element <name/> may not contain element DegreeDate</assert>
      <assert test="empty(OtherHonors)">Element <name/> may not contain element OtherHonors</assert>
      <assert test="empty(DegreeMajor)">Element <name/> may not contain element DegreeMajor</assert>
      <assert test="empty(DegreeMinor)">Element <name/> may not contain element DegreeMinor</assert>
      <assert test="empty(DegreeMeasure)">Element <name/> may not contain element DegreeMeasure</assert>
      <assert test="empty(DatesOfAttendance)">Element <name/> may not contain element DatesOfAttendance</assert>
      <assert test="empty(Comments)">Element <name/> may not contain element Comments</assert>
      <assert test="empty(DegreeClassification)">Element <name/> may not contain element DegreeClassification</assert>
      <assert test="empty(UserArea)">Element <name/> may not contain element UserArea</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory/SchoolOrInstitution/LocalInstitutionClassification/Id">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory/SchoolOrInstitution/LocalInstitutionClassification/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/LicensesAndCertifications/LicenseOrCertification">
      <assert test="empty(Id)">Element <name/> may not contain element Id</assert>
      <assert test="empty(IssuingAuthority)">Element <name/> may not contain element IssuingAuthority</assert>
      <assert test="empty(Description)">Element <name/> may not contain element Description</assert>
      <assert test="empty(EffectiveDate)">Element <name/> may not contain element EffectiveDate</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/Qualifications">
      <assert test="empty(QualificationSummary)">Element <name/> may not contain element QualificationSummary</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/Qualifications/Competency">
      <assert test="empty(@required)">Element <name/> may not have attribute required</assert>
      <assert test="empty(CompetencyId)">Element <name/> may not contain element CompetencyId</assert>
      <assert test="empty(TaxonomyId)">Element <name/> may not contain element TaxonomyId</assert>
      <assert test="empty(CompetencyEvidence)">Element <name/> may not contain element CompetencyEvidence</assert>
      <assert test="empty(CompetencyWeight)">Element <name/> may not contain element CompetencyWeight</assert>
      <assert test="empty(UserArea)">Element <name/> may not contain element UserArea</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/Qualifications/Competency/Competency">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
      <assert test="empty(@description)">Element <name/> may not have attribute description</assert>
      <assert test="empty(@required)">Element <name/> may not have attribute required</assert>
      <assert test="empty(CompetencyId)">Element <name/> may not contain element CompetencyId</assert>
      <assert test="empty(TaxonomyId)">Element <name/> may not contain element TaxonomyId</assert>
      <assert test="empty(CompetencyEvidence)">Element <name/> may not contain element CompetencyEvidence</assert>
      <assert test="empty(CompetencyWeight)">Element <name/> may not contain element CompetencyWeight</assert>
      <assert test="empty(Competency)">Element <name/> may not contain element Competency</assert>
      <assert test="empty(UserArea)">Element <name/> may not contain element UserArea</assert>
    </rule>
  </pattern>
  <pattern id="cardinality-redefines">
    <rule context="StaffingOrder">
      <assert test="count(OrderContact) &lt;= 1">Element <name/> may contain OrderContact at most 1 time(s)</assert>
      <assert test="count(OrderComments) &lt;= 1">Element <name/> may contain OrderComments at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/OrderId">
      <assert test="count(IdValue) &lt;= 2">Element <name/> may contain IdValue at most 2 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation">
      <assert test="count(MasterOrderId) &lt;= 1">Element <name/> may contain MasterOrderId at most 1 time(s)</assert>
      <assert test="count(StaffingCustomerId) &gt;= 1 and count(StaffingCustomerId) &lt;= 1">Element <name/> must contain StaffingCustomerId at least 1 and at most 1 time(s)</assert>
      <assert test="count(StaffingCustomerOrgUnitId) &lt;= 1">Element <name/> may contain StaffingCustomerOrgUnitId at most 1 time(s)</assert>
      <assert test="count(StaffingSupplierId) &lt;= 1">Element <name/> may contain StaffingSupplierId at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/MasterOrderId">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingCustomerId">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingCustomerOrgUnitId">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/ReferenceInformation/StaffingSupplierId">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition">
      <assert test="count(Rates) &lt;= 2">Element <name/> may contain Rates at most 2 time(s)</assert>
      <assert test="count(StaffingShift) &lt;= 1">Element <name/> may contain StaffingShift at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader">
      <assert test="count(RequestedPerson) &lt;= 1">Element <name/> may contain RequestedPerson at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/RequestedPerson/PersonName">
      <assert test="count(GivenName) &lt;= 1">Element <name/> may contain GivenName at most 1 time(s)</assert>
      <assert test="count(FamilyName) &lt;= 1">Element <name/> may contain FamilyName at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/RequestedPerson/PersonId">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader/ShiftWork">
      <assert test="count(Description) &gt;= 1">Element <name/> must contain Description at least 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/OfferId">
      <assert test="count(IdValue) &lt;= 2">Element <name/> may contain IdValue at most 2 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/PreviousOrderId">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/RFQOrderId">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory">
      <assert test="count(SchoolOrInstitution) &lt;= 1">Element <name/> may contain SchoolOrInstitution at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory/SchoolOrInstitution">
      <assert test="count(LocalInstitutionClassification) &gt;= 1 and count(LocalInstitutionClassification) &lt;= 1">Element <name/> must contain LocalInstitutionClassification at least 1 and at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/EducationHistory/SchoolOrInstitution/LocalInstitutionClassification/Id">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="StaffingOrder/UserArea/StaffingOrderAdditionalNL/StructuredXMLResume/Qualifications">
      <assert test="count(Competency) &lt;= 2">Element <name/> may contain Competency at most 2 time(s)</assert>
    </rule>
  </pattern>
  <pattern id="type-restrictions">
    <rule context="StaffingOrder/OrderId">
      <assert test="empty(@idOwner) or (@idOwner='StaffingCustomer') or (@idOwner='')">Attribute @idOwner in <name/> may only have (one of) the following value(s): StaffingCustomer, [Empty]</assert>
    </rule>
    <rule context="StaffingOrder/OrderId/IdValue[2]">
      <assert test="empty(@name) or (@name='version')">Attribute @name in <name/> may only have (one of) the following value(s): version</assert>
    </rule>
    <rule context="StaffingOrder/OrderClassification">
      <assert test="empty(@orderStatus) or (@orderStatus='New') or (@orderStatus='Revised') or (@orderStatus='Closed') or (@orderStatus='Reopened') or (@orderStatus='Cancelled') or (@orderStatus='x:Rejected')">Attribute @orderStatus in <name/> may only have (one of) the following value(s): New, Revised, Closed, Reopened, Cancelled, x:Rejected</assert>
      <assert test="empty(@orderType) or (@orderType='RFQ') or (@orderType='Order')">Attribute @orderType in <name/> may only have (one of) the following value(s): RFQ, Order</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition">
      <assert test="empty(PositionReason) or (PositionReason='Illness') or (PositionReason='Peak') or (PositionReason='Project') or (PositionReason='Reorganisation') or (PositionReason='Position') or (PositionReason='Vacation') or (PositionReason='Maternity') or (PositionReason='Season') or (PositionReason='Replacement') or (PositionReason='Recruitment') or (PositionReason='Structural') or (PositionReason='Other')">Element PositionReason in <name/> may only have (one of) the following value(s): Illness, Peak, Project, Reorganisation, Position, Vacation, Maternity, Season, Replacement, Recruitment, Structural, Other</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/PositionHeader">
      <assert test="empty(PositionType) or (PositionType='recruitment &amp; selection') or (PositionType='secondment') or (PositionType='temporary staffing')">Element PositionType in <name/> may only have (one of) the following value(s): recruitment &amp; selection, secondment, temporary staffing</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/Rates">
      <assert test="empty(@rateType) or (@rateType='bill') or (@rateType='pay') or (@rateType='minPayRate') or (@rateType='maxPayRate') or (@rateType='minBillRate') or (@rateType='maxBillRate')">Attribute @rateType in <name/> may only have (one of) the following value(s): bill, pay, minPayRate, maxPayRate, minBillRate, maxBillRate</assert>
      <assert test="empty(Class) or (Class='TimeInterval') or (Class='Allowance') or (Class='Expense') or (Class='')">Element Class in <name/> may only have (one of) the following value(s): TimeInterval, Allowance, Expense, [Empty]</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/Rates/Amount">
      <assert test="empty(@rateAmountPeriod) or (@rateAmountPeriod='hourly') or (@rateAmountPeriod='x:hourlysplit') or (@rateAmountPeriod='x:hourlyconsolidated') or (@rateAmountPeriod='daily') or (@rateAmountPeriod='weekly') or (@rateAmountPeriod='x:4weekly') or (@rateAmountPeriod='monthly') or (@rateAmountPeriod='yearly')">Attribute @rateAmountPeriod in <name/> may only have (one of) the following value(s): hourly, x:hourlysplit, x:hourlyconsolidated, daily, weekly, x:4weekly, monthly, yearly</assert>
    </rule>
    <rule context="StaffingOrder/StaffingPosition/StaffingShift">
      <assert test="empty(@shiftPeriod) or (@shiftPeriod='weekly')">Attribute @shiftPeriod in <name/> may only have (one of) the following value(s): weekly</assert>
    </rule>
  </pattern>
</schema>
