<?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="TimeCard">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
      <assert test="empty(UserArea)">Element <name/> may not contain element UserArea</assert>
    </rule>
    <rule context="TimeCard/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="TimeCard/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Person/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="TimeCard/ReportedResource/Person/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Person/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="TimeCard/ReportedResource/Person/PersonName/FamilyName">
      <assert test="empty(@primary)">Element <name/> may not have attribute primary</assert>
      <assert test="empty(@prefix)">Element <name/> may not have attribute prefix</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Resource">
      <assert test="empty(@type)">Element <name/> may not have attribute type</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Resource/Id">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@idOwner)">Element <name/> may not have attribute idOwner</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Resource/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Resource/AdditionalData">
      <assert test="empty(@type)">Element <name/> may not have attribute type</assert>
    </rule>
    <rule context="TimeCard/ReportedTime">
      <assert test="empty(Expense)">Element <name/> may not contain element Expense</assert>
      <assert test="empty(AdditionalData)">Element <name/> may not contain element AdditionalData</assert>
      <assert test="empty(ApprovalInfo)">Element <name/> may not contain element ApprovalInfo</assert>
      <assert test="empty(SubmitterInfo)">Element <name/> may not contain element SubmitterInfo</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/ReportedPersonAssignment">
      <assert test="empty(Id)">Element <name/> may not contain element Id</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval">
      <assert test="empty(@dayAssignment)">Element <name/> may not have attribute dayAssignment</assert>
      <assert test="empty(PieceWork)">Element <name/> may not contain element PieceWork</assert>
      <assert test="empty(ApprovalInfo)">Element <name/> may not contain element ApprovalInfo</assert>
      <assert test="empty(SubmitterInfo)">Element <name/> may not contain element SubmitterInfo</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/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="TimeCard/ReportedTime/TimeInterval/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/RateOrAmount">
      <assert test="empty(@period)">Element <name/> may not have attribute period</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/Allowance">
      <assert test="empty(AdditionalData)">Element <name/> may not contain element AdditionalData</assert>
      <assert test="empty(ApprovalInfo)">Element <name/> may not contain element ApprovalInfo</assert>
      <assert test="empty(SubmitterInfo)">Element <name/> may not contain element SubmitterInfo</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/Allowance/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="TimeCard/ReportedTime/TimeInterval/Allowance/Comment">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/AdditionalData">
      <assert test="empty(@type)">Element <name/> may not have attribute type</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/AdditionalData/StaffingAdditionalData">
      <assert test="empty(ReferenceInformation)">Element <name/> may not contain element ReferenceInformation</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/AdditionalData/StaffingAdditionalData/CustomerReportingRequirements">
      <assert test="empty(PurchaseOrderLineItem)">Element <name/> may not contain element PurchaseOrderLineItem</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/AdditionalData/StaffingAdditionalData/CustomerReportingRequirements/AdditionalRequirement">
      <assert test="empty(@requirementTitle)">Element <name/> may not have attribute requirementTitle</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/Comment">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent">
      <assert test="empty(@dayAssignment)">Element <name/> may not have attribute dayAssignment</assert>
      <assert test="empty(AdditionalData)">Element <name/> may not contain element AdditionalData</assert>
      <assert test="empty(ApprovalInfo)">Element <name/> may not contain element ApprovalInfo</assert>
      <assert test="empty(SubmitterInfo)">Element <name/> may not contain element SubmitterInfo</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent/Id">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@idOwner)">Element <name/> may not have attribute idOwner</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent/RateOrAmount">
      <assert test="empty(@period)">Element <name/> may not have attribute period</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent/Comment">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/Allowance">
      <assert test="empty(AdditionalData)">Element <name/> may not contain element AdditionalData</assert>
      <assert test="empty(ApprovalInfo)">Element <name/> may not contain element ApprovalInfo</assert>
      <assert test="empty(SubmitterInfo)">Element <name/> may not contain element SubmitterInfo</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/Allowance/Id">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@idOwner)">Element <name/> may not have attribute idOwner</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/Allowance/Comment">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
    </rule>
    <rule context="TimeCard/SubmitterInfo/Person/Id">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@idOwner)">Element <name/> may not have attribute idOwner</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="TimeCard/SubmitterInfo/Person/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/SubmitterInfo/Person/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(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="TimeCard/ApprovalInfo">
      <assert test="empty(@approverType)">Element <name/> may not have attribute approverType</assert>
    </rule>
    <rule context="TimeCard/ApprovalInfo/Person/Id">
      <assert test="empty(@validFrom)">Element <name/> may not have attribute validFrom</assert>
      <assert test="empty(@idOwner)">Element <name/> may not have attribute idOwner</assert>
      <assert test="empty(@validTo)">Element <name/> may not have attribute validTo</assert>
    </rule>
    <rule context="TimeCard/ApprovalInfo/Person/Id/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/ApprovalInfo/Person/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(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="TimeCard/ApprovalInfo/Comment">
      <assert test="empty(@lang)">Element <name/> may not have attribute lang</assert>
    </rule>
    <rule context="TimeCard/AdditionalData">
      <assert test="empty(@type)">Element <name/> may not have attribute type</assert>
    </rule>
    <rule context="TimeCard/AdditionalData/StaffingAdditionalData/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(LocationCode)">Element <name/> may not contain element LocationCode</assert>
      <assert test="empty(LocationName)">Element <name/> may not contain element LocationName</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>
    </rule>
    <rule context="TimeCard/AdditionalData/StaffingAdditionalData/ReferenceInformation">
      <assert test="empty(OrderId)">Element <name/> may not contain element OrderId</assert>
      <assert test="empty(PositionId)">Element <name/> may not contain element PositionId</assert>
      <assert test="empty(IntermediaryId)">Element <name/> may not contain element IntermediaryId</assert>
      <assert test="empty(MasterOrderId)">Element <name/> may not contain element MasterOrderId</assert>
      <assert test="empty(HumanResourceId)">Element <name/> may not contain element HumanResourceId</assert>
      <assert test="empty(StaffingSupplierOrgUnitId)">Element <name/> may not contain element StaffingSupplierOrgUnitId</assert>
      <assert test="empty(StaffingCustomerOrgUnitId)">Element <name/> may not contain element StaffingCustomerOrgUnitId</assert>
      <assert test="empty(InvoiceId)">Element <name/> may not contain element InvoiceId</assert>
      <assert test="empty(BillToEntityId)">Element <name/> may not contain element BillToEntityId</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="TimeCard/AdditionalData/StaffingAdditionalData/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="TimeCard/AdditionalData/StaffingAdditionalData/ReferenceInformation/StaffingSupplierId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/AdditionalData/StaffingAdditionalData/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="TimeCard/AdditionalData/StaffingAdditionalData/ReferenceInformation/StaffingCustomerId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/AdditionalData/StaffingAdditionalData/ReferenceInformation/AssignmentId">
      <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="TimeCard/AdditionalData/StaffingAdditionalData/ReferenceInformation/AssignmentId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
    <rule context="TimeCard/AdditionalData/StaffingAdditionalData/ReferenceInformation/DocumentId">
      <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="TimeCard/AdditionalData/StaffingAdditionalData/ReferenceInformation/DocumentId/IdValue">
      <assert test="empty(@name)">Element <name/> may not have attribute name</assert>
    </rule>
  </pattern>
  <pattern id="cardinality-redefines">
    <rule context="TimeCard">
      <assert test="count(Id) &gt;= 1">Element <name/> must contain Id at least 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/Id">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Person/Id">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedResource/Person/PersonName">
      <assert test="count(GivenName) &lt;= 1">Element <name/> may contain GivenName at most 1 time(s)</assert>
      <assert test="count(FamilyName) &lt;= 2">Element <name/> may contain FamilyName at most 2 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime">
      <assert test="count(TimeInterval) &lt;= -1">Element <name/> may contain TimeInterval at most -1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/Id">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/Allowance">
      <assert test="count(Amount) &gt;= 1">Element <name/> must contain Amount at least 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/Allowance/Id">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/Allowance/Id/IdValue">
      <assert test="count(@name) &gt;= 1">Attribute <name/> must contain @name at least 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/AdditionalData/StaffingAdditionalData">
      <assert test="count(CustomerReportingRequirements) &lt;= -1">Element <name/> may contain CustomerReportingRequirements at most -1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent/Id">
      <assert test="count(IdValue) &lt;= 1">Element <name/> may contain IdValue at most 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/Allowance">
      <assert test="count(Amount) &gt;= 1">Element <name/> must contain Amount at least 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/Allowance/Id/IdValue">
      <assert test="count(@name) &gt;= 1">Attribute <name/> must contain @name at least 1 time(s)</assert>
    </rule>
    <rule context="TimeCard/AdditionalData/StaffingAdditionalData">
      <assert test="count(CustomerReportingRequirements) &lt;= -1">Element <name/> may contain CustomerReportingRequirements at most -1 time(s)</assert>
      <assert test="count(ReferenceInformation) &lt;= -1">Element <name/> may contain ReferenceInformation at most -1 time(s)</assert>
    </rule>
  </pattern>
  <pattern id="type-restrictions">
    <rule context="TimeCard/ReportedTime/TimeInterval">
      <assert test="empty(@type) or (@type='Regular') or (@type='Overtime') or (@type='Shift') or (@type='Travel') or (@type='Additional') or (@type='Special Leave') or (@type='Short leave') or (@type='Holiday') or (@type='Unpaid leave') or (@type='Training') or (@type='Vacation') or (@type='Reduction of working hours') or (@type='Sick time') or (@type='Work underload') or (@type='Care Leave')">Attribute @type in <name/> may only have (one of) the following value(s): Regular, Overtime, Shift, Travel, Additional, Special Leave, Short leave, Holiday, Unpaid leave, Training, Vacation, Reduction of working hours, Sick time, Work underload, Care Leave</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeInterval/RateOrAmount">
      <assert test="empty(@type) or (@type='hourly') or (@type='hourlysplit') or (@type='hourlyconsolidated') or (@type='daily') or (@type='dailysplit') or (@type='dailyconsolidated')">Attribute @type in <name/> may only have (one of) the following value(s): hourly, hourlysplit, hourlyconsolidated, daily, dailysplit, dailyconsolidated</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent">
      <assert test="empty(@type) or (@type='Regular') or (@type='Overtime') or (@type='Shift') or (@type='Travel') or (@type='Additional') or (@type='Special Leave') or (@type='Short leave') or (@type='Holiday') or (@type='Unpaid leave') or (@type='Training') or (@type='Vacation') or (@type='Reduction of working hours') or (@type='Sick time') or (@type='Work underload') or (@type='Care Leave')">Attribute @type in <name/> may only have (one of) the following value(s): Regular, Overtime, Shift, Travel, Additional, Special Leave, Short leave, Holiday, Unpaid leave, Training, Vacation, Reduction of working hours, Sick time, Work underload, Care Leave</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/TimeEvent/RateOrAmount">
      <assert test="empty(@type) or (@type='hourly') or (@type='hourlysplit') or (@type='hourlyconsolidated') or (@type='daily') or (@type='dailysplit') or (@type='dailyconsolidated')">Attribute @type in <name/> may only have (one of) the following value(s): hourly, hourlysplit, hourlyconsolidated, daily, dailysplit, dailyconsolidated</assert>
    </rule>
    <rule context="TimeCard/ReportedTime/Allowance/Id/IdValue">
      <assert test="empty(@name) or (@name='allowance') or (@name='expense')">Attribute @name in <name/> may only have (one of) the following value(s): allowance, expense</assert>
    </rule>
  </pattern>
</schema>
