Skip to content

Commit

Permalink
Merge pull request #251 from juskoljo/master
Browse files Browse the repository at this point in the history
Fixes UBL-SR-43 issue when root is not using default namespace
  • Loading branch information
oriol authored Jan 20, 2021
2 parents 054fa64 + 920cc01 commit c1a742b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
49 changes: 49 additions & 0 deletions test/CreditNote-unit-UBL/UBL-SR-43.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed under European Union Public Licence (EUPL) version 1.2.
-->
<testSet xmlns="http://difi.no/xsd/vefa/validator/1.0" configuration="tc434-ubl">
<assert>
<description>x</description>
<scope>UBL-SR-43</scope>
</assert>

<test id="1">
<assert>
<success>UBL-SR-43</success>
</assert>
<CreditNote
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2">

<cac:AdditionalDocumentReference>
<cbc:ID>ID</cbc:ID>
<cbc:DocumentTypeCode>50</cbc:DocumentTypeCode>
</cac:AdditionalDocumentReference>

</CreditNote>
</test>

<test id="2">
<assert>
<description>When not using default namespace</description>
<success>UBL-SR-43</success>
</assert>
<ns:CreditNote
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:ns="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2">

<cac:AdditionalDocumentReference>
<cbc:ID>ID</cbc:ID>
<cbc:DocumentTypeCode>50</cbc:DocumentTypeCode>
</cac:AdditionalDocumentReference>

</ns:CreditNote>
</test>


</testSet>
2 changes: 1 addition & 1 deletion ubl/schematron/UBL/EN16931-UBL-syntax.sch
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<param name="UBL-SR-39" value="(count(cac:ProjectReference/cbc:ID) &lt;= 1)"/>
<param name="UBL-SR-40" value="(count(cac:AccountingCustomerParty/cac:Party/cac:PartyName/cbc:Name) &lt;= 1)"/>
<param name="UBL-SR-42" value="(count(cac:PartyTaxScheme) &lt;= 2)"/>
<param name="UBL-SR-43" value="((cbc:DocumentTypeCode='130') or ((name(/*) = 'CreditNote') and (cbc:DocumentTypeCode='50')) or (not(cbc:ID/@scheme) and not(cbc:DocumentTypeCode)))"/>
<param name="UBL-SR-43" value="((cbc:DocumentTypeCode='130') or ((local-name(/*) = 'CreditNote') and (cbc:DocumentTypeCode='50')) or (not(cbc:ID/@scheme) and not(cbc:DocumentTypeCode)))"/>
<param name="UBL-SR-44" value="count(//cbc:PaymentID[not(preceding::cbc:PaymentID/. = .)]) &lt;= 1"/>
<param name="UBL-SR-45" value="(count(cac:PaymentMeans/cbc:PaymentDueDate) &lt;=1)"/>
<param name="UBL-SR-46" value="(count(cac:PaymentMeans/cbc:PaymentMeansCode/@name) &lt;=1)"/>
Expand Down

0 comments on commit c1a742b

Please sign in to comment.