-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Example file: https://github.com/setu-standards/xml-specifications/blob/main/setu/examples/Assignment/StatusAssignmentExample_v1.4.xml
Schematron rules: https://github.com/setu-standards/xml-specifications/blob/main/setu/validator/Assignment-v1.4-Assignment.xml
It creates the follwing errors:
- [[SVRLResourceError@0x4ace284d: ErrorLevel=ERROR; ErrorFieldName=/[local-name()='Assignment']/[local-name()='ReferenceInformation']/*[local-name()='StaffingCustomerId']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=The attribute idOwner of the element StaffingCustomerId must exist exactly once and should have a valid value: ,StaffingCustomer,StaffingCompany,KvK,OIN,BTW,Fi,
Currently '' is used.]]; Test=(count(@idowner)=1) and contains($IdOwner, concat(',', @idowner, ','))], - [[SVRLResourceError@0x64deb58f: ErrorLevel=ERROR; ErrorFieldName=/[local-name()='Assignment']/[local-name()='ReferenceInformation']/*[local-name()='StaffingCustomerId']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=The subelement IdValue of the element StaffingCustomerId must exist exactly once.]]; Test=(count(setu:IdValue)=1) and (normalize-space(setu:IdValue)!='')],
- [[SVRLResourceError@0x2b1cd7bc: ErrorLevel=ERROR; ErrorFieldName=/[local-name()='Assignment']/[local-name()='ReferenceInformation']/*[local-name()='HumanResourceId']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=The attribute idOwner of the element HumanResourceId must exist exactly once and should have a valid value, either 'StaffingCustomer' or 'StaffingCompany'.]]; Test=(count(@idowner)=1) and ((normalize-space(@idowner) = 'StaffingCustomer') or (normalize-space(@idowner) = 'StaffingCompany'))],
- [[SVRLResourceError@0x33379242: ErrorLevel=ERROR; ErrorFieldName=/[local-name()='Assignment']/[local-name()='ReferenceInformation']/*[local-name()='HumanResourceId']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=The subelement IdValue of the element HumanResourceId must exist exactly once.]]; Test=(count(setu:IdValue)=1) and (normalize-space(setu:IdValue)!='')],
- [[SVRLResourceError@0x2e32fc22: ErrorLevel=ERROR; ErrorFieldName=/[local-name()='Assignment']/[local-name()='Rates']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=The attribute rateType of the element Rates must contain one of the following values: ,pay,bill,
Currently '' is used.]]; Test=contains($RateType, concat(',', @rateType, ','))], - [[SVRLResourceError@0x3f5156a6: ErrorLevel=ERROR; ErrorFieldName=/*[local-name()='Assignment']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=The element InclusiveRate must exist when an element Rates is present.]]; Test=(count(setu:Rates) = 0) or (count(setu:UserArea/nl:AssignmentAdditionalNL/nl:InclusiveRate) = 1)],
- [[SVRLResourceError@0x72bdd7c7: ErrorLevel=ERROR; ErrorFieldName=/*[local-name()='Assignment']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=If you specify Hours, do not use MinimumHours and MaximumHours. If you specify MinimumHours and/or MaximumHours, do no use Hours. This only holds when the container element ContractStaffingShift is not specified.]]; Test=((count(setu:StaffingShift/setu:Hours) > 0) and not(count(setu:UserArea/nl:AssignmentAdditionalNL/nl:HumanResourceInformation/nl:StaffingShiftAddition) > 0)) or (not(count(setu:StaffingShift/setu:Hours) > 0) and (count(setu:UserArea/nl:AssignmentAdditionalNL/nl:HumanResourceInformation/nl:StaffingShiftAddition) > 0))],
- [[SVRLResourceError@0x7d17ee50: ErrorLevel=ERROR; ErrorFieldName=/*[local-name()='Assignment']; ErrorLocation=[ResourceID=/Users/philip/dev/git/phive-rules/phive-rules-setu/src/test/resources/external/test-files/1.4/assignment/StatusAssignmentExample_v1.4.xml]; ErrorText=[Text=If the attribute contractShiftPeriod is not specified, you must specify the shiftPeriod]]; Test=(count(setu:StaffingShift[@shiftPeriod]) > 0) or (count(setu:CustomerReportingRequirements/setu:AdditionalRequirement[@requirementTitle = 'shiftPeriodExtension']) > 0)]
To resolve the errors, I changed
<StaffingCustomerId>
<IdValue/>
</StaffingCustomerId>
<HumanResourceId>
<IdValue/>
</HumanResourceId>
...
<Rates rateStatus="agreed" rateType="">
...
<StaffingShift>
<Id>
<IdValue/>
</Id>
</StaffingShift>to
<StaffingCustomerId idOwner="StaffingCompany">
<IdValue>223445</IdValue>
</StaffingCustomerId>
<HumanResourceId idOwner="StaffingCompany">
<IdValue>179943169</IdValue>
</HumanResourceId>
...
<Rates rateStatus="agreed" rateType="pay">
...
<StaffingShift shiftPeriod="weekly">
<Id>
<IdValue/>
</Id>
<Hours>32</Hours>
</StaffingShift>As well as adding in the SETU generic part
<nl:InclusiveRate>true</nl:InclusiveRate>Metadata
Metadata
Assignees
Labels
No labels