upgraded ph-schematron
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
- zugferdimporter to accept xml files
|
||||
- UBL importer to also parse contacts
|
||||
- https://github.com/ZUGFeRD/mustangproject/pull/369
|
||||
- upgrade ph-scematron from 6.3.3 to 8
|
||||
|
||||
2.10.0
|
||||
=======
|
||||
|
||||
@@ -53,6 +53,17 @@
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<!-- for ph-schematron -->
|
||||
<dependency>
|
||||
<groupId>com.helger.commons</groupId>
|
||||
<artifactId>ph-commons</artifactId>
|
||||
<version>11.1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
<version>4.0.1</version>
|
||||
</dependency>
|
||||
<!-- /for ph-schematron -->
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
@@ -88,7 +99,7 @@
|
||||
<dependency>
|
||||
<groupId>com.helger.schematron</groupId>
|
||||
<artifactId>ph-schematron-xslt</artifactId>
|
||||
<version>6.3.3</version>
|
||||
<version>8.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.helger</groupId>
|
||||
|
||||
@@ -273,15 +273,20 @@ public class XMLValidator extends Validator {
|
||||
LOGGER.debug("UBL");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "UBL_21/maindoc/UBL-Invoice-2.1.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/UBL_21/EN16931-UBL-validation.xsl";
|
||||
validateSchematron(zfXML, xsltFilename, 24, ESeverity.error);
|
||||
|
||||
if (isXRechnung) {
|
||||
LOGGER.debug("is XRechnung");
|
||||
/*
|
||||
the validation against the XRechnung Schematron will happen below but a
|
||||
XRechnung is a EN16931 subset so the validation vis a vis FACTUR-X_EN16931.xslt=schematron also has to pass
|
||||
* */
|
||||
//validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "ZF_211/EN16931/FACTUR-X_EN16931.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/XR_30/XRechnung-UBL-validation.xslt";
|
||||
String xrVersion=context.getProfile().substring(context.getProfile().length()-3).replace(".","");
|
||||
if (!xrVersion.equals("12")&&!xrVersion.equals("20")&&!xrVersion.equals("21")&&!xrVersion.equals("22")&&!xrVersion.equals("23")&&!xrVersion.equals("30")) {
|
||||
throw new Exception("Unsupported XR version");
|
||||
}
|
||||
LOGGER.debug("is XRechnung v"+xrVersion);
|
||||
xsltFilename = "/xslt/XR_"+xrVersion+"/XRechnung-UBL-validation.xslt";
|
||||
XrechnungSeverity = ESeverity.error;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,579 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:saxon="http://saxon.sf.net/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:schold="http://www.ascc.net/xml/schematron"
|
||||
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is
|
||||
the preferred method for meta-stylesheets to use where possible. -->
|
||||
<xsl:param name="archiveDirParameter"/>
|
||||
<xsl:param name="archiveNameParameter"/>
|
||||
<xsl:param name="fileNameParameter"/>
|
||||
<xsl:param name="fileDirParameter"/>
|
||||
<xsl:variable name="document-uri">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:variable>
|
||||
|
||||
<!--PHASES-->
|
||||
|
||||
|
||||
<!--PROLOG-->
|
||||
<xsl:output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
method="xml"
|
||||
omit-xml-declaration="no"
|
||||
standalone="yes"
|
||||
indent="yes"/>
|
||||
|
||||
<!--XSD TYPES FOR XSLT2-->
|
||||
|
||||
|
||||
<!--KEYS AND FUNCTIONS-->
|
||||
|
||||
|
||||
<!--DEFAULT RULES-->
|
||||
|
||||
|
||||
<!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-select-full-path">
|
||||
<xsl:apply-templates select="." mode="schematron-get-full-path-3"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">
|
||||
<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>*:</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>[namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:variable name="preceding"
|
||||
select="count(preceding-sibling::*[local-name()=local-name(current()) and namespace-uri() = namespace-uri(current())])"/>
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="1+ $preceding"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>@*[local-name()='</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>' and namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-2-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="preceding-sibling::*[name(.)=name(current())]">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-3-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans
|
||||
(Top-level element has index)-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-3">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="parent::*">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: GENERATE-ID-FROM-PATH -->
|
||||
<xsl:template match="/" mode="generate-id-from-path"/>
|
||||
<xsl:template match="text()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="comment()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="processing-instruction()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.@', name())"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: GENERATE-ID-2 -->
|
||||
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-2" priority="2">
|
||||
<xsl:text>U</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="node()" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>n</xsl:text>
|
||||
<xsl:number count="node()"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="string-length(local-name(.))"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="translate(name(),':','.')"/>
|
||||
</xsl:template>
|
||||
<!--Strip characters-->
|
||||
<xsl:template match="text()" priority="-1"/>
|
||||
|
||||
<!--SCHEMA SETUP-->
|
||||
<xsl:template match="/">
|
||||
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
title="Schematron Version 1.3.0 - XRechnung 1.2.2 compatible - UBL - Invoice"
|
||||
schemaVersion="">
|
||||
<xsl:comment>
|
||||
<xsl:value-of select="$archiveDirParameter"/>
|
||||
<xsl:value-of select="$archiveNameParameter"/>
|
||||
<xsl:value-of select="$fileNameParameter"/>
|
||||
<xsl:value-of select="$fileDirParameter"/>
|
||||
</xsl:comment>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
prefix="cbc"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
prefix="cac"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
prefix="ext"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
prefix="ubl"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">model-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">model-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M7"/>
|
||||
</svrl:schematron-output>
|
||||
</xsl:template>
|
||||
|
||||
<!--SCHEMATRON PATTERNS-->
|
||||
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">Schematron Version 1.3.0 - XRechnung 1.2.2 compatible - UBL - Invoice</svrl:text>
|
||||
|
||||
<!--PATTERN model-pattern-->
|
||||
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice" priority="1007" mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PaymentMeans"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:PaymentMeans">
|
||||
<xsl:attribute name="id">BR-DE-1</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-1] Eine Rechnung (INVOICE) muss Angaben zu "PAYMENT INSTRUCTIONS" (BG-16) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count((cac:PaymentMeans/cac:PayeeFinancialAccount)[1]) + count(cac:PaymentMeans/cac:CardAccount) + count(cac:PaymentMeans/cac:PaymentMandate) = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="count((cac:PaymentMeans/cac:PayeeFinancialAccount)[1]) + count(cac:PaymentMeans/cac:CardAccount) + count(cac:PaymentMeans/cac:PaymentMandate) = 1">
|
||||
<xsl:attribute name="id">BR-DE-13</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-13] In der Rechnung müssen Angaben zu genau einer der drei Gruppen "CREDIT TRANSFER" (BG-17), "PAYMENT CARD INFORMATION" (BG-18) oder "DIRECT DEBIT" (BG-19) übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:BuyerReference[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:BuyerReference[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-15</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-15] Das Element "Buyer reference" (BT-10) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="(cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="(cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])">
|
||||
<xsl:attribute name="id">BR-DE-16</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-16] In der Rechnung muss mindestens eines der Elemente "Seller VAT identifier" (BT-31), "Seller tax registration identifier" (BT-32) oder "SELLER TAX REPRESENTATIVE PARTY" (BG-11) übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')">
|
||||
<xsl:attribute name="id">BR-DE-17</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-17] Mit dem Element Invoice type code (BT-3) sollen ausschließlich folgende Codes aus der Codeliste UNTDID 1001 übermittelt werden: 326 (Partial invoice), 380 (Commercial invoice), 384 (Corrected invoice), 389 (Self-billed invoice) und 381 (Credit note),875 (Partial construction invoice), 876 (Partial final construction invoice), 877 (Final construction invoice).</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="every $line in cac:PaymentTerms/cbc:Note/tokenize(.,'(\r\n|\r|\n)') satisfies if(count(tokenize($line,'#')) > 1) then tokenize($line,'#')[1]='' and (tokenize($line,'#')[2]='SKONTO' or tokenize($line,'#')[2]='VERZUG') and string-length(replace(tokenize($line,'#')[3],'TAGE=[0-9]+',''))=0 and string-length(replace(tokenize($line,'#')[4],'PROZENT=[0-9]+\.[0-9]{2}',''))=0 and (tokenize($line,'#')[5]='' and empty(tokenize($line,'#')[6]) or string-length(replace(tokenize($line,'#')[5],'BASISBETRAG=[0-9]+\.[0-9]{2}',''))=0 and tokenize($line,'#')[6]='' and empty(tokenize($line,'#')[7])) else true()"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="every $line in cac:PaymentTerms/cbc:Note/tokenize(.,'(\r\n|\r|\n)') satisfies if(count(tokenize($line,'#')) > 1) then tokenize($line,'#')[1]='' and (tokenize($line,'#')[2]='SKONTO' or tokenize($line,'#')[2]='VERZUG') and string-length(replace(tokenize($line,'#')[3],'TAGE=[0-9]+',''))=0 and string-length(replace(tokenize($line,'#')[4],'PROZENT=[0-9]+\.[0-9]{2}',''))=0 and (tokenize($line,'#')[5]='' and empty(tokenize($line,'#')[6]) or string-length(replace(tokenize($line,'#')[5],'BASISBETRAG=[0-9]+\.[0-9]{2}',''))=0 and tokenize($line,'#')[6]='' and empty(tokenize($line,'#')[7])) else true()">
|
||||
<xsl:attribute name="id">BR-DE-18</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-18] Die Informationen zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO" oder "VERZUG", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto oder Verzugszins als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skonto oder Verzugsangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CustomizationID = 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2'"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CustomizationID = 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2'">
|
||||
<xsl:attribute name="id">BR-DE-21</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-21] Das Element "Specification identifier" (BT-24) soll syntaktisch der Kennung des Standards XRechnung entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingSupplierParty"
|
||||
priority="1006"
|
||||
mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:Party/cac:Contact"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:Party/cac:Contact">
|
||||
<xsl:attribute name="id">BR-DE-2</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-2] Die Gruppe "SELLER CONTACT" (BG-6) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress"
|
||||
priority="1005"
|
||||
mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-3</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-3] Das Element "Seller city" (BT-37) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-4</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-4] Das Element "Seller post code" (BT-38) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:Contact"
|
||||
priority="1004"
|
||||
mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Name[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Name[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-5</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-5] Das Element "Seller contact point" (BT-41) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Telephone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Telephone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-6</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-6] Das Element "Seller contact telephone number" (BT-42) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:ElectronicMail[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:ElectronicMail[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-7</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-7] Das Element "Seller contact email address" (BT-43) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress"
|
||||
priority="1003"
|
||||
mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-8</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-8] Das Element "Buyer city" (BT-52) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-9</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-9] Das Element "Buyer post code" (BT-53) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address"
|
||||
priority="1002"
|
||||
mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-10</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-10] Das Element "Deliver to city" (BT-77) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-11</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-11] Das Element "Deliver to post code" (BT-78) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:PaymentMeans" priority="1001" mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test=" not(cbc:PaymentMeansCode = '58') or matches(cac:PayeeFinancialAccount/cbc:ID, '[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}') and xs:integer( replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace( upper-case(concat(substring(cac:PayeeFinancialAccount/cbc:ID,5),substring(cac:PayeeFinancialAccount/cbc:ID,1,4))) ,'A','10'),'B','11'),'C','12'),'D','13'),'E','14'),'F','15'),'G','16'),'H','17'),'I','18'),'J','19'),'K','20'),'L','21'),'M','22') ,'N','23'),'O','24'),'P','25'),'Q','26'),'R','27'),'S','28'),'T','29'),'U','30'),'V','31'),'W','32'),'X','33'),'Y','34'),'Z','35') ) mod 97 = 1 "/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '58') or matches(cac:PayeeFinancialAccount/cbc:ID, '[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}') and xs:integer( replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace( upper-case(concat(substring(cac:PayeeFinancialAccount/cbc:ID,5),substring(cac:PayeeFinancialAccount/cbc:ID,1,4))) ,'A','10'),'B','11'),'C','12'),'D','13'),'E','14'),'F','15'),'G','16'),'H','17'),'I','18'),'J','19'),'K','20'),'L','21'),'M','22') ,'N','23'),'O','24'),'P','25'),'Q','26'),'R','27'),'S','28'),'T','29'),'U','30'),'V','31'),'W','32'),'X','33'),'Y','34'),'Z','35') ) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-19</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-19] "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:PaymentMeansCode = '59') or matches(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}') and xs:integer( replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace( upper-case(concat(substring(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID,5),substring(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID,1,4))) ,'A','10'),'B','11'),'C','12'),'D','13'),'E','14'),'F','15'),'G','16'),'H','17'),'I','18'),'J','19'),'K','20'),'L','21'),'M','22') ,'N','23'),'O','24'),'P','25'),'Q','26'),'R','27'),'S','28'),'T','29'),'U','30'),'V','31'),'W','32'),'X','33'),'Y','34'),'Z','35') ) mod 97 = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '59') or matches(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}') and xs:integer( replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace( upper-case(concat(substring(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID,5),substring(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID,1,4))) ,'A','10'),'B','11'),'C','12'),'D','13'),'E','14'),'F','15'),'G','16'),'H','17'),'I','18'),'J','19'),'K','20'),'L','21'),'M','22') ,'N','23'),'O','24'),'P','25'),'Q','26'),'R','27'),'S','28'),'T','29'),'U','30'),'V','31'),'W','32'),'X','33'),'Y','34'),'Z','35') ) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-20</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-20] "Debited account identifier" (BT-91) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 59 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal"
|
||||
priority="1000"
|
||||
mode="M7">
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-14</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-14] Das Element "VAT category rate" (BT-119) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" priority="-1" mode="M7"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M7">
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,721 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:saxon="http://saxon.sf.net/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:schold="http://www.ascc.net/xml/schematron"
|
||||
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is
|
||||
the preferred method for meta-stylesheets to use where possible. -->
|
||||
<xsl:param name="archiveDirParameter"/>
|
||||
<xsl:param name="archiveNameParameter"/>
|
||||
<xsl:param name="fileNameParameter"/>
|
||||
<xsl:param name="fileDirParameter"/>
|
||||
<xsl:variable name="document-uri">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:variable>
|
||||
|
||||
<!--PHASES-->
|
||||
|
||||
|
||||
<!--PROLOG-->
|
||||
<xsl:output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
method="xml"
|
||||
omit-xml-declaration="no"
|
||||
standalone="yes"
|
||||
indent="yes"/>
|
||||
|
||||
<!--XSD TYPES FOR XSLT2-->
|
||||
|
||||
|
||||
<!--KEYS AND FUNCTIONS-->
|
||||
|
||||
|
||||
<!--DEFAULT RULES-->
|
||||
|
||||
|
||||
<!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-select-full-path">
|
||||
<xsl:apply-templates select="." mode="schematron-get-full-path-3"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">
|
||||
<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>*:</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>[namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:variable name="preceding"
|
||||
select="count(preceding-sibling::*[local-name()=local-name(current()) and namespace-uri() = namespace-uri(current())])"/>
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="1+ $preceding"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>@*[local-name()='</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>' and namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-2-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="preceding-sibling::*[name(.)=name(current())]">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-3-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans
|
||||
(Top-level element has index)-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-3">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="parent::*">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: GENERATE-ID-FROM-PATH -->
|
||||
<xsl:template match="/" mode="generate-id-from-path"/>
|
||||
<xsl:template match="text()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="comment()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="processing-instruction()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.@', name())"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: GENERATE-ID-2 -->
|
||||
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-2" priority="2">
|
||||
<xsl:text>U</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="node()" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>n</xsl:text>
|
||||
<xsl:number count="node()"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="string-length(local-name(.))"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="translate(name(),':','.')"/>
|
||||
</xsl:template>
|
||||
<!--Strip characters-->
|
||||
<xsl:template match="text()" priority="-1"/>
|
||||
|
||||
<!--SCHEMA SETUP-->
|
||||
<xsl:template match="/">
|
||||
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
title="Schematron Version 1.5.0 - XRechnung 2.0.1 compatible - UBL - Invoice"
|
||||
schemaVersion="">
|
||||
<xsl:attribute name="phase">xrechnung-model</xsl:attribute>
|
||||
<xsl:comment>
|
||||
<xsl:value-of select="$archiveDirParameter"/>
|
||||
<xsl:value-of select="$archiveNameParameter"/>
|
||||
<xsl:value-of select="$fileNameParameter"/>
|
||||
<xsl:value-of select="$fileDirParameter"/>
|
||||
</xsl:comment>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
prefix="cbc"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
prefix="cac"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
prefix="ext"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
prefix="ubl"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">variable-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">variable-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M7"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">model-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">model-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M8"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">ubl-extension-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">ubl-extension-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M9"/>
|
||||
</svrl:schematron-output>
|
||||
</xsl:template>
|
||||
|
||||
<!--SCHEMATRON PATTERNS-->
|
||||
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">Schematron Version 1.5.0 - XRechnung 2.0.1 compatible - UBL - Invoice</svrl:text>
|
||||
|
||||
<!--PATTERN variable-pattern-->
|
||||
<xsl:variable name="XR-SKONTO-REGEX"
|
||||
select="'#(SKONTO|VERZUG)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$'"/>
|
||||
<xsl:template match="text()" priority="-1" mode="M7"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M7">
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--PATTERN model-pattern-->
|
||||
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice" priority="1007" mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="//ubl:Invoice"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PaymentMeans"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:PaymentMeans">
|
||||
<xsl:attribute name="id">BR-DE-1</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-1] Eine Rechnung (INVOICE) muss Angaben zu "PAYMENT INSTRUCTIONS" (BG-16) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count((cac:PaymentMeans/cac:PayeeFinancialAccount)[1]) + count(cac:PaymentMeans/cac:CardAccount) + count(cac:PaymentMeans/cac:PaymentMandate) = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="count((cac:PaymentMeans/cac:PayeeFinancialAccount)[1]) + count(cac:PaymentMeans/cac:CardAccount) + count(cac:PaymentMeans/cac:PaymentMandate) = 1">
|
||||
<xsl:attribute name="id">BR-DE-13</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-13] In der Rechnung müssen Angaben zu genau einer der drei Gruppen "CREDIT TRANSFER" (BG-17), "PAYMENT CARD INFORMATION" (BG-18) oder "DIRECT DEBIT" (BG-19) übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:BuyerReference[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:BuyerReference[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-15</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-15] Das Element "Buyer reference" (BT-10) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not((cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'false' and following-sibling::cac:TaxScheme/cbc:ID = 'VAT'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'true'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or (cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not((cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'false' and following-sibling::cac:TaxScheme/cbc:ID = 'VAT'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'true'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or (cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])">
|
||||
<xsl:attribute name="id">BR-DE-16</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-16] In der Rechnung muss mindestens eines der Elemente "Seller VAT identifier" (BT-31), "Seller tax registration identifier" (BT-32) oder "SELLER TAX REPRESENTATIVE PARTY" (BG-11) übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')">
|
||||
<xsl:attribute name="id">BR-DE-17</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-17] Mit dem Element Invoice type code (BT-3) sollen ausschließlich folgende Codes aus der Codeliste UNTDID 1001 übermittelt werden: 326 (Partial invoice), 380 (Commercial invoice), 384 (Corrected invoice), 389 (Self-billed invoice) und 381 (Credit note),875 (Partial construction invoice), 876 (Partial final construction invoice), 877 (Final construction invoice).</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="every $line in cac:PaymentTerms/cbc:Note[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX ) and matches( cac:PaymentTerms/cbc:Note[1]/text(), '\n\s*$' ) "/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="every $line in cac:PaymentTerms/cbc:Note[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX ) and matches( cac:PaymentTerms/cbc:Note[1]/text(), '\n\s*$' )">
|
||||
<xsl:attribute name="id">BR-DE-18</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-18] Skonto/Verzug Zeilen in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> muessen diesem regulaerem Ausdruck entsprechen: <xsl:text/>
|
||||
<xsl:value-of select="$XR-SKONTO-REGEX"/>
|
||||
<xsl:text/>. Die Informationen zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO" oder "VERZUG", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto oder Verzugszins als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skonto oder Verzugsangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CustomizationID = 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0' or cbc:CustomizationID = 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0'"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CustomizationID = 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0' or cbc:CustomizationID = 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0'">
|
||||
<xsl:attribute name="id">BR-DE-21</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-21] Das Element "Specification identifier" (BT-24) soll syntaktisch der Kennung des Standards XRechnung entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])">
|
||||
<xsl:attribute name="id">BR-DE-22</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-22] Not all filename attributes of the embeddedDocumentBinaryObject elements are unique
|
||||
</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingSupplierParty"
|
||||
priority="1006"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="//ubl:Invoice/cac:AccountingSupplierParty"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:Party/cac:Contact"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:Party/cac:Contact">
|
||||
<xsl:attribute name="id">BR-DE-2</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-2] Die Gruppe "SELLER CONTACT" (BG-6) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress"
|
||||
priority="1005"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="//ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-3</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-3] Das Element "Seller city" (BT-37) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-4</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-4] Das Element "Seller post code" (BT-38) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:Contact"
|
||||
priority="1004"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="//ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:Contact"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Name[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Name[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-5</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-5] Das Element "Seller contact point" (BT-41) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Telephone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Telephone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-6</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-6] Das Element "Seller contact telephone number" (BT-42) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:ElectronicMail[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:ElectronicMail[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-7</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-7] Das Element "Seller contact email address" (BT-43) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress"
|
||||
priority="1003"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="//ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-8</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-8] Das Element "Buyer city" (BT-52) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-9</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-9] Das Element "Buyer post code" (BT-53) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address"
|
||||
priority="1002"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="//ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-10</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-10] Das Element "Deliver to city" (BT-77) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-11</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-11] Das Element "Deliver to post code" (BT-78) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:PaymentMeans" priority="1001" mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="//ubl:Invoice/cac:PaymentMeans"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:PaymentMeansCode = '58') or matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '58') or matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-19</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-19] "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:PaymentMeansCode = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-20</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-20] "Debited account identifier" (BT-91) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 59 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="//ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal"
|
||||
priority="1000"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="//ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-14</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-14] Das Element "VAT category rate" (BT-119) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" priority="-1" mode="M8"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M8">
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--PATTERN ubl-extension-pattern-->
|
||||
<xsl:variable name="isExtension"
|
||||
select="exists(/ubl:Invoice/cbc:CustomizationID[text() = 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0'])"/>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="cbc:EmbeddedDocumentBinaryObject[$isExtension]"
|
||||
priority="1001"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cbc:EmbeddedDocumentBinaryObject[$isExtension]"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test=".[@mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml']"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test=".[@mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml']">
|
||||
<xsl:attribute name="id">BR-DEX-01</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-01] Das Element <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> "Attached Document" (BT-125) benutzt einen nicht zulässigen MIME-Code: <xsl:text/>
|
||||
<xsl:value-of select="@mimeCode"/>
|
||||
<xsl:text/>. Im Falle einer Extension darf zusätzlich zu der Liste der mime codes (definiert in Abschnitt 8.2, "Binary Object") der MIME-Code application/xml genutzt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M9"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice[$isExtension]" priority="1000" mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice[$isExtension]"/>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [xs:decimal(cbc:LineExtensionAmount) = sum(child::cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [xs:decimal(cbc:LineExtensionAmount) = sum(child::cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))">
|
||||
<xsl:attribute name="id">BR-DEX-02</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-02] Der Wert von "Invoice line net amount" (BT-131) einer "INVOICE LINE"
|
||||
(BG-25) oder einer "SUB INVOICE LINE" (BG-DEX-01) soll der Summe
|
||||
der "Invoice line net amount" (BT-131) der direkt darunterliegenden "SUB
|
||||
INVOICE LINE" (BG-DEX-01) entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(exists(//cac:SubInvoiceLine/cac:Item[ count ( cac:ClassifiedTaxCategory) != 1]))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(exists(//cac:SubInvoiceLine/cac:Item[ count ( cac:ClassifiedTaxCategory) != 1]))">
|
||||
<xsl:attribute name="id">BR-DEX-03</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-03] Eine Sub Invoice Line (BG-DEX-01) muss genau eine "SUB INVOICE LINE VAT INFORMATION" (BG-DEX-06) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M9"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" priority="-1" mode="M9"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M9">
|
||||
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M9"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,779 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:saxon="http://saxon.sf.net/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:schold="http://www.ascc.net/xml/schematron"
|
||||
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is
|
||||
the preferred method for meta-stylesheets to use where possible. -->
|
||||
<xsl:param name="archiveDirParameter"/>
|
||||
<xsl:param name="archiveNameParameter"/>
|
||||
<xsl:param name="fileNameParameter"/>
|
||||
<xsl:param name="fileDirParameter"/>
|
||||
<xsl:variable name="document-uri">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:variable>
|
||||
<!--PHASES-->
|
||||
<!--PROLOG-->
|
||||
<xsl:output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
method="xml"
|
||||
omit-xml-declaration="no"
|
||||
standalone="yes"
|
||||
indent="yes"/>
|
||||
<!--XSD TYPES FOR XSLT2-->
|
||||
<!--KEYS AND FUNCTIONS-->
|
||||
<!--DEFAULT RULES-->
|
||||
<!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-select-full-path">
|
||||
<xsl:apply-templates select="." mode="schematron-get-full-path-3"/>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">
|
||||
<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>*:</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>[namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:variable name="preceding"
|
||||
select="count(preceding-sibling::*[local-name()=local-name(current()) and namespace-uri() = namespace-uri(current())])"/>
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="1+ $preceding"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>@*[local-name()='</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>' and namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-2-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="preceding-sibling::*[name(.)=name(current())]">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-3-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans
|
||||
(Top-level element has index)-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-3">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="parent::*">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!--MODE: GENERATE-ID-FROM-PATH -->
|
||||
<xsl:template match="/" mode="generate-id-from-path"/>
|
||||
<xsl:template match="text()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="comment()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="processing-instruction()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.@', name())"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')"/>
|
||||
</xsl:template>
|
||||
<!--MODE: GENERATE-ID-2 -->
|
||||
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-2" priority="2">
|
||||
<xsl:text>U</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="node()" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>n</xsl:text>
|
||||
<xsl:number count="node()"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="string-length(local-name(.))"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="translate(name(),':','.')"/>
|
||||
</xsl:template>
|
||||
<!--Strip characters-->
|
||||
<xsl:template match="text()" priority="-1"/>
|
||||
<!--SCHEMA SETUP-->
|
||||
<xsl:template match="/">
|
||||
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
title="Schematron Version 1.6.0 - XRechnung 2.1.1 compatible - UBL - Invoice"
|
||||
schemaVersion="">
|
||||
<xsl:attribute name="phase">xrechnung-model</xsl:attribute>
|
||||
<xsl:comment>
|
||||
<xsl:value-of select="$archiveDirParameter"/>
|
||||
<xsl:value-of select="$archiveNameParameter"/>
|
||||
<xsl:value-of select="$fileNameParameter"/>
|
||||
<xsl:value-of select="$fileDirParameter"/>
|
||||
</xsl:comment>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
prefix="cbc"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
prefix="cac"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
prefix="ext"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
prefix="ubl"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">variable-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">variable-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M7"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">ubl-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">ubl-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M8"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">ubl-extension-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">ubl-extension-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M9"/>
|
||||
</svrl:schematron-output>
|
||||
</xsl:template>
|
||||
<!--SCHEMATRON PATTERNS-->
|
||||
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">Schematron Version 1.6.0 - XRechnung 2.1.1 compatible - UBL - Invoice</svrl:text>
|
||||
<!--PATTERN variable-pattern-->
|
||||
<xsl:variable name="XR-MAJOR-MINOR-VERSION" select="'2.1'"/>
|
||||
<xsl:variable name="XR-CIUS-ID"
|
||||
select="concat('urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_', $XR-MAJOR-MINOR-VERSION )"/>
|
||||
<xsl:variable name="XR-EXTENSION-ID"
|
||||
select="concat($XR-CIUS-ID, '#conformant#urn:xoev-de:kosit:extension:xrechnung_' ,$XR-MAJOR-MINOR-VERSION )"/>
|
||||
<xsl:variable name="XR-SKONTO-REGEX"
|
||||
select="'#(SKONTO|VERZUG)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$'"/>
|
||||
<xsl:variable name="BT-81"
|
||||
select="'rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:TypeCode'"/>
|
||||
<xsl:template match="text()" priority="-1" mode="M7"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M7">
|
||||
<xsl:apply-templates select="*" mode="M7"/>
|
||||
</xsl:template>
|
||||
<!--PATTERN ubl-pattern-->
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice" priority="1009" mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="/ubl:Invoice"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PaymentMeans"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:PaymentMeans">
|
||||
<xsl:attribute name="id">BR-DE-1</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-1] Eine Rechnung (INVOICE) muss Angaben zu "PAYMENT INSTRUCTIONS" (BG-16) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:BuyerReference[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:BuyerReference[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-15</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-15] Das Element "Buyer reference" (BT-10) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not((cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'false' and following-sibling::cac:TaxScheme/cbc:ID = 'VAT'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'true'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or (cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not((cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'false' and following-sibling::cac:TaxScheme/cbc:ID = 'VAT'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'true'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or (cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])">
|
||||
<xsl:attribute name="id">BR-DE-16</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-16] In der Rechnung muss mindestens eines der Elemente "Seller VAT identifier" (BT-31), "Seller tax registration identifier" (BT-32) oder "SELLER TAX REPRESENTATIVE PARTY" (BG-11) übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')">
|
||||
<xsl:attribute name="id">BR-DE-17</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-17] Mit dem Element "Invoice type code" (BT-3) sollen ausschließlich folgende Codes aus der Codeliste UNTDID 1001 übermittelt werden: 326 (Partial invoice), 380 (Commercial invoice), 384 (Corrected invoice), 389 (Self-billed invoice) und 381 (Credit note),875 (Partial construction invoice), 876 (Partial final construction invoice), 877 (Final construction invoice).</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="every $line in cac:PaymentTerms/cbc:Note[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX) and matches( cac:PaymentTerms/cbc:Note[1]/tokenize(. , '#.+#')[last()], '^\s*\n' )"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="every $line in cac:PaymentTerms/cbc:Note[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX) and matches( cac:PaymentTerms/cbc:Note[1]/tokenize(. , '#.+#')[last()], '^\s*\n' )">
|
||||
<xsl:attribute name="id">BR-DE-18</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-18] Skonto/Verzug Zeilen in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> müssen diesem regulärem Ausdruck entsprechen: <xsl:text/>
|
||||
<xsl:value-of select="$XR-SKONTO-REGEX"/>
|
||||
<xsl:text/>. Die Informationen zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO" oder "VERZUG", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto oder Verzugszins als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skonto oder Verzugsangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CustomizationID = $XR-CIUS-ID or cbc:CustomizationID = $XR-EXTENSION-ID"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CustomizationID = $XR-CIUS-ID or cbc:CustomizationID = $XR-EXTENSION-ID">
|
||||
<xsl:attribute name="id">BR-DE-21</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-21] Das Element "Specification identifier" (BT-24) soll syntaktisch der Kennung des Standards XRechnung entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])">
|
||||
<xsl:attribute name="id">BR-DE-22</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-22] Das "filename"-Attribut aller "EmbeddedDocumentBinaryObject"-Elemente muss eindeutig sein</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:InvoiceTypeCode = 384) or (cac:BillingReference/cac:InvoiceDocumentReference)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:InvoiceTypeCode = 384) or (cac:BillingReference/cac:InvoiceDocumentReference)">
|
||||
<xsl:attribute name="id">BR-DE-26</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-26] Wenn im Element "Invoice type code" (BT-3) der Code 384 (Corrected invoice) übergeben wird, soll PRECEDING INVOICE REFERENCE BG-3 mind. einmal vorhanden sein.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingSupplierParty"
|
||||
priority="1008"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingSupplierParty"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:Party/cac:Contact"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:Party/cac:Contact">
|
||||
<xsl:attribute name="id">BR-DE-2</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-2] Die Gruppe "SELLER CONTACT" (BG-6) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress"
|
||||
priority="1007"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-3</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-3] Das Element "Seller city" (BT-37) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-4</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-4] Das Element "Seller post code" (BT-38) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:Contact"
|
||||
priority="1006"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:Contact"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Name[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Name[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-5</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-5] Das Element "Seller contact point" (BT-41) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Telephone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Telephone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-6</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-6] Das Element "Seller contact telephone number" (BT-42) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:ElectronicMail[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:ElectronicMail[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-7</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-7] Das Element "Seller contact email address" (BT-43) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress"
|
||||
priority="1005"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-8</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-8] Das Element "Buyer city" (BT-52) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-9</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-9] Das Element "Buyer post code" (BT-53) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address"
|
||||
priority="1004"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-10</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-10] Das Element "Deliver to city" (BT-77) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-11</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-11] Das Element "Deliver to post code" (BT-78) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (30,58)]"
|
||||
priority="1003"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (30,58)]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:PaymentMeansCode = '58') or matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '58') or matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-19</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-19] "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PayeeFinancialAccount"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cac:PayeeFinancialAccount">
|
||||
<xsl:attribute name="id">BR-DE-23-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-23-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Überweisungen enthält (30, 58), muss BG-17 "CREDIT TRANSFER" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cac:CardAccount) and not(cac:PaymentMandate)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cac:CardAccount) and not(cac:PaymentMandate)">
|
||||
<xsl:attribute name="id">BR-DE-23-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-23-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Überweisungen enthält (30, 58), dürfen BG-18 und BG-19 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (48,54,55)]"
|
||||
priority="1002"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (48,54,55)]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:CardAccount"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:CardAccount">
|
||||
<xsl:attribute name="id">BR-DE-24-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-24-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Kartenzahlungen enthält (48, 54, 55), muss genau BG-18 "PAYMENT CARD INFORMATION" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cac:PayeeFinancialAccount) and not(cac:PaymentMandate)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cac:PayeeFinancialAccount) and not(cac:PaymentMandate)">
|
||||
<xsl:attribute name="id">BR-DE-24-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-24-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Kartenzahlungen enthält (48, 54, 55), dürfen BG-17 und BG-19 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = 59]"
|
||||
priority="1001"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = 59]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:PaymentMeansCode = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-20</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-20] "Debited account identifier" (BT-91) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 59 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PaymentMandate"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:PaymentMandate">
|
||||
<xsl:attribute name="id">BR-DE-25-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-25-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Lastschriften enthält (59), muss genau BG-19 "DIRECT DEBIT" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cac:PayeeFinancialAccount) and not(cac:CardAccount)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cac:PayeeFinancialAccount) and not(cac:CardAccount)">
|
||||
<xsl:attribute name="id">BR-DE-25-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-25-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Lastschriften enthält (59), dürfen BG-17 und BG-18 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal"
|
||||
priority="1000"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-14</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-14] Das Element "VAT category rate" (BT-119) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" priority="-1" mode="M8"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M8">
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--PATTERN ubl-extension-pattern-->
|
||||
<xsl:variable name="isExtension"
|
||||
select="exists(/ubl:Invoice/cbc:CustomizationID[text() = concat( 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_', $XR-MAJOR-MINOR-VERSION ,'#conformant#urn:xoev-de:kosit:extension:xrechnung_', $XR-MAJOR-MINOR-VERSION) ] )"/>
|
||||
<!--RULE -->
|
||||
<xsl:template match="cbc:EmbeddedDocumentBinaryObject[$isExtension]"
|
||||
priority="1001"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cbc:EmbeddedDocumentBinaryObject[$isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test=".[@mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml']"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test=".[@mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml']">
|
||||
<xsl:attribute name="id">BR-DEX-01</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-01] Das Element <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> "Attached Document" (BT-125) benutzt einen nicht zulässigen MIME-Code: <xsl:text/>
|
||||
<xsl:value-of select="@mimeCode"/>
|
||||
<xsl:text/>. Im Falle einer Extension darf zusätzlich zu der Liste der mime codes (definiert in Abschnitt 8.2, "Binary Object") der MIME-Code application/xml genutzt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice[$isExtension]" priority="1000" mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice[$isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [xs:decimal(cbc:LineExtensionAmount) = sum(child::cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [xs:decimal(cbc:LineExtensionAmount) = sum(child::cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))">
|
||||
<xsl:attribute name="id">BR-DEX-02</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-02] Der Wert von "Invoice line net amount" (BT-131) einer "INVOICE LINE"
|
||||
(BG-25) oder einer "SUB INVOICE LINE" (BG-DEX-01) soll der Summe
|
||||
der "Invoice line net amount" (BT-131) der direkt darunterliegenden "SUB
|
||||
INVOICE LINE" (BG-DEX-01) entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(exists(//cac:SubInvoiceLine/cac:Item[ count ( cac:ClassifiedTaxCategory) != 1]))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(exists(//cac:SubInvoiceLine/cac:Item[ count ( cac:ClassifiedTaxCategory) != 1]))">
|
||||
<xsl:attribute name="id">BR-DEX-03</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-03] Eine Sub Invoice Line (BG-DEX-01) muss genau eine "SUB INVOICE LINE VAT INFORMATION" (BG-DEX-06) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" priority="-1" mode="M9"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M9">
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -1,685 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<xsl:stylesheet xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:ccts="urn:un:unece:uncefact:documentation:standard:CoreComponentsTechnicalSpecification:2" xmlns:iso="http://purl.oclc.org/dsdl/schematron" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:saxon="http://saxon.sf.net/" xmlns:schold="http://www.ascc.net/xml/schematron" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
||||
<!--Implementers: please note that overriding process-prolog or process-root is
|
||||
the preferred method for meta-stylesheets to use where possible. -->
|
||||
|
||||
<xsl:param name="archiveDirParameter" />
|
||||
<xsl:param name="archiveNameParameter" />
|
||||
<xsl:param name="fileNameParameter" />
|
||||
<xsl:param name="fileDirParameter" />
|
||||
<xsl:variable name="document-uri">
|
||||
<xsl:value-of select="document-uri(/)" />
|
||||
</xsl:variable>
|
||||
|
||||
<!--PHASES-->
|
||||
|
||||
|
||||
<!--PROLOG-->
|
||||
<xsl:output indent="yes" method="xml" omit-xml-declaration="no" standalone="yes" />
|
||||
|
||||
<!--XSD TYPES FOR XSLT2-->
|
||||
|
||||
|
||||
<!--KEYS AND FUNCTIONS-->
|
||||
|
||||
|
||||
<!--DEFAULT RULES-->
|
||||
|
||||
|
||||
<!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-select-full-path">
|
||||
<xsl:apply-templates mode="schematron-get-full-path" select="." />
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates mode="schematron-get-full-path" select="parent::*" />
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">
|
||||
<xsl:value-of select="name()" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>*:</xsl:text>
|
||||
<xsl:value-of select="local-name()" />
|
||||
<xsl:text>[namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()" />
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:variable name="preceding" select="count(preceding-sibling::*[local-name()=local-name(current()) and namespace-uri() = namespace-uri(current())])" />
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="1+ $preceding" />
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates mode="schematron-get-full-path" select="parent::*" />
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>@*[local-name()='</xsl:text>
|
||||
<xsl:value-of select="local-name()" />
|
||||
<xsl:text>' and namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()" />
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-2-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)" />
|
||||
<xsl:if test="preceding-sibling::*[name(.)=name(current())]">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1" />
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text />/@<xsl:value-of select="name(.)" />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-3-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans
|
||||
(Top-level element has index)-->
|
||||
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-3">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)" />
|
||||
<xsl:if test="parent::*">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1" />
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text />/@<xsl:value-of select="name(.)" />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: GENERATE-ID-FROM-PATH -->
|
||||
<xsl:template match="/" mode="generate-id-from-path" />
|
||||
<xsl:template match="text()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
|
||||
<xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')" />
|
||||
</xsl:template>
|
||||
<xsl:template match="comment()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
|
||||
<xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')" />
|
||||
</xsl:template>
|
||||
<xsl:template match="processing-instruction()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
|
||||
<xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')" />
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-from-path">
|
||||
<xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
|
||||
<xsl:value-of select="concat('.@', name())" />
|
||||
</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
|
||||
<xsl:apply-templates mode="generate-id-from-path" select="parent::*" />
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')" />
|
||||
</xsl:template>
|
||||
|
||||
<!--MODE: GENERATE-ID-2 -->
|
||||
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-2" priority="2">
|
||||
<xsl:text>U</xsl:text>
|
||||
<xsl:number count="*" level="multiple" />
|
||||
</xsl:template>
|
||||
<xsl:template match="node()" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number count="*" level="multiple" />
|
||||
<xsl:text>n</xsl:text>
|
||||
<xsl:number count="node()" />
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number count="*" level="multiple" />
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="string-length(local-name(.))" />
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="translate(name(),':','.')" />
|
||||
</xsl:template>
|
||||
<!--Strip characters--> <xsl:template match="text()" priority="-1" />
|
||||
|
||||
<!--SCHEMA SETUP-->
|
||||
<xsl:template match="/">
|
||||
<svrl:schematron-output schemaVersion="" title="Schematron Version 1.6.0 - XRechnung 2.1.1 compatible - CII">
|
||||
<xsl:attribute name="phase">xrechnung-model</xsl:attribute>
|
||||
<xsl:comment>
|
||||
<xsl:value-of select="$archiveDirParameter" />
|
||||
<xsl:value-of select="$archiveNameParameter" />
|
||||
<xsl:value-of select="$fileNameParameter" />
|
||||
<xsl:value-of select="$fileDirParameter" />
|
||||
</xsl:comment>
|
||||
<svrl:ns-prefix-in-attribute-values prefix="rsm" uri="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" />
|
||||
<svrl:ns-prefix-in-attribute-values prefix="ccts" uri="urn:un:unece:uncefact:documentation:standard:CoreComponentsTechnicalSpecification:2" />
|
||||
<svrl:ns-prefix-in-attribute-values prefix="udt" uri="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" />
|
||||
<svrl:ns-prefix-in-attribute-values prefix="qdt" uri="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" />
|
||||
<svrl:ns-prefix-in-attribute-values prefix="ram" uri="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" />
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)" />
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">variable-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">variable-pattern</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates mode="M7" select="/" />
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)" />
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">cii-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">cii-pattern</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates mode="M8" select="/" />
|
||||
</svrl:schematron-output>
|
||||
</xsl:template>
|
||||
|
||||
<!--SCHEMATRON PATTERNS-->
|
||||
<svrl:text>Schematron Version 1.6.0 - XRechnung 2.1.1 compatible - CII</svrl:text>
|
||||
|
||||
<!--PATTERN variable-pattern-->
|
||||
<xsl:variable name="XR-MAJOR-MINOR-VERSION" select="'2.1'" />
|
||||
<xsl:variable name="XR-CIUS-ID" select="concat('urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_', $XR-MAJOR-MINOR-VERSION )" />
|
||||
<xsl:variable name="XR-EXTENSION-ID" select="concat($XR-CIUS-ID, '#conformant#urn:xoev-de:kosit:extension:xrechnung_' ,$XR-MAJOR-MINOR-VERSION )" />
|
||||
<xsl:variable name="XR-SKONTO-REGEX" select="'#(SKONTO|VERZUG)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$'" />
|
||||
<xsl:variable name="BT-81" select="'rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:TypeCode'" />
|
||||
<xsl:template match="text()" mode="M7" priority="-1" />
|
||||
<xsl:template match="@*|node()" mode="M7" priority="-2">
|
||||
<xsl:apply-templates mode="M7" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--PATTERN cii-pattern-->
|
||||
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice" mode="M8" priority="1010">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans">
|
||||
<xsl:attribute name="id">BR-DE-1</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-1] Eine Rechnung (INVOICE) muss Angaben zu "PAYMENT INSTRUCTIONS" (BG-16) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerReference[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerReference[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-15</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-15] Das Element "Buyer reference" (BT-10) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not((rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:TypeCode = 'VAT' and rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:CategoryTradeTax = 'VAT' and rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:CategoryTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:TypeCode = 'VAT' and rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or ((rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA' or @schemeID='VAT' or @schemeID='FC'][boolean(normalize-space(.))], rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty))" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="not((rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:TypeCode = 'VAT' and rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:CategoryTradeTax = 'VAT' and rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:CategoryTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:TypeCode = 'VAT' and rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or ((rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA' or @schemeID='VAT' or @schemeID='FC'][boolean(normalize-space(.))], rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty))">
|
||||
<xsl:attribute name="id">BR-DE-16</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-16] In der Rechnung muss mindestens eines der Elemente "Seller VAT identifier" (BT-31), "Seller tax registration identifier" (BT-32) oder "SELLER TAX REPRESENTATIVE PARTY" (BG-11) übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="rsm:ExchangedDocument/ram:TypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="rsm:ExchangedDocument/ram:TypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')">
|
||||
<xsl:attribute name="id">BR-DE-17</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-17] Mit dem Element "Invoice type code" (BT-3) sollen ausschließlich folgende Codes aus der Codeliste UNTDID 1001 übermittelt werden: 326 (Partial invoice), 380 (Commercial invoice), 384 (Corrected invoice), 389 (Self-billed invoice) und 381 (Credit note),875 (Partial construction invoice), 876 (Partial final construction invoice), 877 (Final construction invoice).</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="every $line in rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX ) and matches( rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description/tokenize(. , '#.+#')[last()], '^\s*\n' )" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="every $line in rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX ) and matches( rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description/tokenize(. , '#.+#')[last()], '^\s*\n' )">
|
||||
<xsl:attribute name="id">BR-DE-18</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-18] Skonto/Verzug Zeilen in <xsl:text />
|
||||
<xsl:value-of select="name(.)" />
|
||||
<xsl:text /> muessen diesem regulärem Ausdruck entsprechen: <xsl:text />
|
||||
<xsl:value-of select="$XR-SKONTO-REGEX" />
|
||||
<xsl:text />. Die Informationen zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO" oder "VERZUG", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto oder Verzugszins als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skonto oder Verzugsangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(//ram:AdditionalReferencedDocument) = count(//ram:AdditionalReferencedDocument[not(./ram:AttachmentBinaryObject/@filename = preceding-sibling::ram:AdditionalReferencedDocument/ram:AttachmentBinaryObject/@filename)])" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="count(//ram:AdditionalReferencedDocument) = count(//ram:AdditionalReferencedDocument[not(./ram:AttachmentBinaryObject/@filename = preceding-sibling::ram:AdditionalReferencedDocument/ram:AttachmentBinaryObject/@filename)])">
|
||||
<xsl:attribute name="id">BR-DE-22</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-22] Not all filename attributes of the embeddedDocumentBinaryObject elements are unique</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(rsm:ExchangedDocument/ram:TypeCode = 384) or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument)" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="not(rsm:ExchangedDocument/ram:TypeCode = 384) or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument)">
|
||||
<xsl:attribute name="id">BR-DE-26</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-26] Wenn im Element Invoice type code (BT-3) der Code 384 (Corrected invoice) übergeben wird, soll PRECEDING INVOICE REFERENCE BG-3 mind. einmal vorhanden sein.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext" mode="M8" priority="1009">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:GuidelineSpecifiedDocumentContextParameter/ram:ID = $XR-CIUS-ID" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:GuidelineSpecifiedDocumentContextParameter/ram:ID = $XR-CIUS-ID">
|
||||
<xsl:attribute name="id">BR-DE-21</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-21] Das Element "Specification identifier" (BT-24) soll syntaktisch der Kennung des Standards XRechnung entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty" mode="M8" priority="1008">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:DefinedTradeContact" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:DefinedTradeContact">
|
||||
<xsl:attribute name="id">BR-DE-2</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-2] Die Gruppe "SELLER CONTACT" (BG-6) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress" mode="M8" priority="1007">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:CityName[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-3</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-3] Das Element "Seller city" (BT-37) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:PostcodeCode[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:PostcodeCode[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-4</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-4] Das Element "Seller post code" (BT-38) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:DefinedTradeContact" mode="M8" priority="1006">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:DefinedTradeContact" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="(ram:PersonName,ram:DepartmentName)[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="(ram:PersonName,ram:DepartmentName)[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-5</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-5] Das Element "Seller contact point" (BT-41) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:TelephoneUniversalCommunication/ram:CompleteNumber[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:TelephoneUniversalCommunication/ram:CompleteNumber[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-6</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-6] Das Element "Seller contact telephone number" (BT-42) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:EmailURIUniversalCommunication/ram:URIID[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:EmailURIUniversalCommunication/ram:URIID[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-7</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-7] Das Element "Seller contact email address" (BT-43) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress" mode="M8" priority="1005">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:CityName[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-8</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-8] Das Element "Buyer city" (BT-52) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:PostcodeCode[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:PostcodeCode[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-9</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-9] Das Element "Buyer post code" (BT-53) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ram:ShipToTradeParty/ram:PostalTradeAddress" mode="M8" priority="1004">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ram:ShipToTradeParty/ram:PostalTradeAddress" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:CityName[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-10</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-10] Das Element "Deliver to city" (BT-77) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:PostcodeCode[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:PostcodeCode[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-11</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-11] Das Element "Deliver to post code" (BT-78) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[ram:TypeCode = (30,58)]" mode="M8" priority="1003">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[ram:TypeCode = (30,58)]" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(ram:TypeCode = '58') or matches(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="not(ram:TypeCode = '58') or matches(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-19</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-19] "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:PayeePartyCreditorFinancialAccount" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:PayeePartyCreditorFinancialAccount">
|
||||
<xsl:attribute name="id">BR-DE-23-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-23-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Überweisungen enthält (30, 58), muss BG-17 "CREDIT TRANSFER" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(ram:ApplicableTradeSettlementFinancialCard) and not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID or ram:PayerPartyDebtorFinancialAccount/ram:IBANID)" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="not(ram:ApplicableTradeSettlementFinancialCard) and not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID or ram:PayerPartyDebtorFinancialAccount/ram:IBANID)">
|
||||
<xsl:attribute name="id">BR-DE-23-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-23-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Überweisungen enthält (30, 58), dürfen BG-18 und BG-19 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[ram:TypeCode = (48,54,55)]" mode="M8" priority="1002">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[ram:TypeCode = (48,54,55)]" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:ApplicableTradeSettlementFinancialCard" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:ApplicableTradeSettlementFinancialCard">
|
||||
<xsl:attribute name="id">BR-DE-24-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-24-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Kartenzahlungen enthält (48, 54, 55), muss genau BG-18 "PAYMENT CARD INFORMATION" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(ram:PayeePartyCreditorFinancialAccount) and not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID or ram:PayerPartyDebtorFinancialAccount/ram:IBANID)" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="not(ram:PayeePartyCreditorFinancialAccount) and not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID or ram:PayerPartyDebtorFinancialAccount/ram:IBANID)">
|
||||
<xsl:attribute name="id">BR-DE-24-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-24-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Kartenzahlungen enthält (48, 54, 55), dürfen BG-17 und BG-19 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[ram:TypeCode = 59]" mode="M8" priority="1001">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[ram:TypeCode = 59]" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(ram:TypeCode = '59') or matches(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="not(ram:TypeCode = '59') or matches(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-20</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-20] "Debited account identifier" (BT-91) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 59 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID or ram:PayerPartyDebtorFinancialAccount/ram:IBANID" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID or ram:PayerPartyDebtorFinancialAccount/ram:IBANID">
|
||||
<xsl:attribute name="id">BR-DE-25-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-25-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Lastschriften enthält (59), muss genau BG-19 "DIRECT DEBIT" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(ram:PayeePartyCreditorFinancialAccount) and not(ram:ApplicableTradeSettlementFinancialCard)" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="not(ram:PayeePartyCreditorFinancialAccount) and not(ram:ApplicableTradeSettlementFinancialCard)">
|
||||
<xsl:attribute name="id">BR-DE-25-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-25-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Lastschriften enthält (59), dürfen BG-17 und BG-18 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
|
||||
<!--RULE -->
|
||||
<xsl:template match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax" mode="M8" priority="1000">
|
||||
<svrl:fired-rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax" />
|
||||
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="ram:RateApplicablePercent[boolean(normalize-space(.))]" />
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert test="ram:RateApplicablePercent[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-14</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates mode="schematron-select-full-path" select="." />
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-14] Das Element "VAT category rate" (BT-119) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" mode="M8" priority="-1" />
|
||||
<xsl:template match="@*|node()" mode="M8" priority="-2">
|
||||
<xsl:apply-templates mode="M8" select="*" />
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,941 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:saxon="http://saxon.sf.net/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:schold="http://www.ascc.net/xml/schematron"
|
||||
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is
|
||||
the preferred method for meta-stylesheets to use where possible. -->
|
||||
<xsl:param name="archiveDirParameter"/>
|
||||
<xsl:param name="archiveNameParameter"/>
|
||||
<xsl:param name="fileNameParameter"/>
|
||||
<xsl:param name="fileDirParameter"/>
|
||||
<xsl:variable name="document-uri">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:variable>
|
||||
<!--PHASES-->
|
||||
<!--PROLOG-->
|
||||
<xsl:output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
method="xml"
|
||||
omit-xml-declaration="no"
|
||||
standalone="yes"
|
||||
indent="yes"/>
|
||||
<!--XSD TYPES FOR XSLT2-->
|
||||
<!--KEYS AND FUNCTIONS-->
|
||||
<!--DEFAULT RULES-->
|
||||
<!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-select-full-path">
|
||||
<xsl:apply-templates select="." mode="schematron-get-full-path-3"/>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-->
|
||||
<!--This mode can be used to generate an ugly though full XPath for locators-->
|
||||
<xsl:template match="*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">
|
||||
<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>*:</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>[namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:variable name="preceding"
|
||||
select="count(preceding-sibling::*[local-name()=local-name(current()) and namespace-uri() = namespace-uri(current())])"/>
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="1+ $preceding"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="schematron-get-full-path">
|
||||
<xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>@*[local-name()='</xsl:text>
|
||||
<xsl:value-of select="local-name()"/>
|
||||
<xsl:text>' and namespace-uri()='</xsl:text>
|
||||
<xsl:value-of select="namespace-uri()"/>
|
||||
<xsl:text>']</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-2-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-2">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="preceding-sibling::*[name(.)=name(current())]">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!--MODE: SCHEMATRON-FULL-PATH-3-->
|
||||
<!--This mode can be used to generate prefixed XPath for humans
|
||||
(Top-level element has index)-->
|
||||
<xsl:template match="node() | @*" mode="schematron-get-full-path-3">
|
||||
<xsl:for-each select="ancestor-or-self::*">
|
||||
<xsl:text>/</xsl:text>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:if test="parent::*">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="not(self::*)">
|
||||
<xsl:text/>/@<xsl:value-of select="name(.)"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
<!--MODE: GENERATE-ID-FROM-PATH -->
|
||||
<xsl:template match="/" mode="generate-id-from-path"/>
|
||||
<xsl:template match="text()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="comment()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="processing-instruction()" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-from-path">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:value-of select="concat('.@', name())"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
|
||||
<xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')"/>
|
||||
</xsl:template>
|
||||
<!--MODE: GENERATE-ID-2 -->
|
||||
<xsl:template match="/" mode="generate-id-2">U</xsl:template>
|
||||
<xsl:template match="*" mode="generate-id-2" priority="2">
|
||||
<xsl:text>U</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="node()" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>n</xsl:text>
|
||||
<xsl:number count="node()"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="@*" mode="generate-id-2">
|
||||
<xsl:text>U.</xsl:text>
|
||||
<xsl:number level="multiple" count="*"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="string-length(local-name(.))"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="translate(name(),':','.')"/>
|
||||
</xsl:template>
|
||||
<!--Strip characters-->
|
||||
<xsl:template match="text()" priority="-1"/>
|
||||
<!--SCHEMA SETUP-->
|
||||
<xsl:template match="/">
|
||||
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
title="Schematron Version 1.7.3 - XRechnung 2.2.0 compatible - UBL - Invoice"
|
||||
schemaVersion="">
|
||||
<xsl:attribute name="phase">xrechnung-model</xsl:attribute>
|
||||
<xsl:comment>
|
||||
<xsl:value-of select="$archiveDirParameter"/>
|
||||
<xsl:value-of select="$archiveNameParameter"/>
|
||||
<xsl:value-of select="$fileNameParameter"/>
|
||||
<xsl:value-of select="$fileDirParameter"/>
|
||||
</xsl:comment>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
prefix="cbc"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
prefix="cac"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
prefix="ext"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
|
||||
prefix="ubl"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">variable-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">variable-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M7"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">ubl-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">ubl-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M8"/>
|
||||
<svrl:active-pattern>
|
||||
<xsl:attribute name="document">
|
||||
<xsl:value-of select="document-uri(/)"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="id">ubl-extension-pattern</xsl:attribute>
|
||||
<xsl:attribute name="name">ubl-extension-pattern</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</svrl:active-pattern>
|
||||
<xsl:apply-templates select="/" mode="M9"/>
|
||||
</svrl:schematron-output>
|
||||
</xsl:template>
|
||||
<!--SCHEMATRON PATTERNS-->
|
||||
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">Schematron Version 1.7.3 - XRechnung 2.2.0 compatible - UBL - Invoice</svrl:text>
|
||||
<!--PATTERN variable-pattern-->
|
||||
<xsl:variable name="XR-MAJOR-MINOR-VERSION" select="'2.2'"/>
|
||||
<xsl:variable name="XR-CIUS-ID"
|
||||
select="concat('urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_', $XR-MAJOR-MINOR-VERSION )"/>
|
||||
<xsl:variable name="XR-EXTENSION-ID"
|
||||
select="concat($XR-CIUS-ID, '#conformant#urn:xoev-de:kosit:extension:xrechnung_' ,$XR-MAJOR-MINOR-VERSION )"/>
|
||||
<xsl:variable name="XR-SKONTO-REGEX"
|
||||
select="'#(SKONTO|VERZUG)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$'"/>
|
||||
<xsl:variable name="XR-EMAIL-REGEX"
|
||||
select="'^[a-zA-Z0-9!#\$%&"*+/=?^_`{|}~-]+(\.[a-zA-Z0-9!#\$%&"*+/=?^_`{|}~-]+)*@([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$'"/>
|
||||
<xsl:variable name="XR-TELEPHONE-REGEX" select="'.*([0-9].*){3,}.*'"/>
|
||||
<xsl:variable name="BT-81"
|
||||
select="'rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:TypeCode'"/>
|
||||
<xsl:variable name="ISO-6523-ICD-EXT-CODES"
|
||||
select="' 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 XR01 XR02 XR03 '"/>
|
||||
<xsl:variable name="CEF-EAS-EXT-CODES"
|
||||
select="' 0002 0007 0009 0037 0060 0088 0096 0097 0106 0130 0135 0142 0151 0183 0184 0190 0191 0192 0193 0194 0195 0196 0198 0199 0200 0201 0202 0203 0204 0208 0209 0210 0211 0212 0213 9901 9902 9904 9905 9906 9907 9910 9913 9914 9915 9918 9919 9920 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9955 9957 AN AQ AS AU EM XR01 XR02 XR03 '"/>
|
||||
<xsl:template match="text()" priority="-1" mode="M7"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M7">
|
||||
<xsl:apply-templates select="*" mode="M7"/>
|
||||
</xsl:template>
|
||||
<!--PATTERN ubl-pattern-->
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice" priority="1009" mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="/ubl:Invoice"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PaymentMeans"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:PaymentMeans">
|
||||
<xsl:attribute name="id">BR-DE-1</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-1] Eine Rechnung (INVOICE) muss Angaben zu "PAYMENT INSTRUCTIONS" (BG-16) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:BuyerReference[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:BuyerReference[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-15</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-15] Das Element "Buyer reference" (BT-10) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not((cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'false' and following-sibling::cac:TaxScheme/cbc:ID = 'VAT'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'true'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or (cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not((cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'false' and following-sibling::cac:TaxScheme/cbc:ID = 'VAT'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:AllowanceCharge/cac:TaxCategory/cbc:ID[ancestor::cac:AllowanceCharge/cbc:ChargeIndicator = 'true'] = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or (cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])">
|
||||
<xsl:attribute name="id">BR-DE-16</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-16] In der Rechnung muss mindestens eines der Elemente "Seller VAT identifier" (BT-31), "Seller tax registration identifier" (BT-32) oder "SELLER TAX REPRESENTATIVE PARTY" (BG-11) übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:InvoiceTypeCode = ('326', '380', '384', '389', '381', '875', '876', '877')">
|
||||
<xsl:attribute name="id">BR-DE-17</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-17] Mit dem Element "Invoice type code" (BT-3) sollen ausschließlich folgende Codes aus der Codeliste UNTDID 1001 übermittelt werden: 326 (Partial invoice), 380 (Commercial invoice), 384 (Corrected invoice), 389 (Self-billed invoice) und 381 (Credit note),875 (Partial construction invoice), 876 (Partial final construction invoice), 877 (Final construction invoice).</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="every $line in cac:PaymentTerms/cbc:Note[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX) and matches( cac:PaymentTerms/cbc:Note[1]/tokenize(. , '#.+#')[last()], '^\s*\n' )"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="every $line in cac:PaymentTerms/cbc:Note[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX) and matches( cac:PaymentTerms/cbc:Note[1]/tokenize(. , '#.+#')[last()], '^\s*\n' )">
|
||||
<xsl:attribute name="id">BR-DE-18</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-18] Skonto/Verzug Zeilen in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> müssen diesem regulärem Ausdruck entsprechen: <xsl:text/>
|
||||
<xsl:value-of select="$XR-SKONTO-REGEX"/>
|
||||
<xsl:text/>. Die Informationen zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO" oder "VERZUG", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto oder Verzugszins als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skonto oder Verzugsangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto oder zur Berechnung von Verzugszinsen müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CustomizationID = $XR-CIUS-ID or cbc:CustomizationID = $XR-EXTENSION-ID"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CustomizationID = $XR-CIUS-ID or cbc:CustomizationID = $XR-EXTENSION-ID">
|
||||
<xsl:attribute name="id">BR-DE-21</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-21] Das Element "Specification identifier" (BT-24) soll syntaktisch der Kennung des Standards XRechnung entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])">
|
||||
<xsl:attribute name="id">BR-DE-22</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-22] Das "filename"-Attribut aller "EmbeddedDocumentBinaryObject"-Elemente muss eindeutig sein</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:InvoiceTypeCode = 384) or (cac:BillingReference/cac:InvoiceDocumentReference)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:InvoiceTypeCode = 384) or (cac:BillingReference/cac:InvoiceDocumentReference)">
|
||||
<xsl:attribute name="id">BR-DE-26</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-26] Wenn im Element "Invoice type code" (BT-3) der Code 384 (Corrected invoice) übergeben wird, soll PRECEDING INVOICE REFERENCE BG-3 mind. einmal vorhanden sein.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingSupplierParty"
|
||||
priority="1008"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingSupplierParty"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:Party/cac:Contact"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:Party/cac:Contact">
|
||||
<xsl:attribute name="id">BR-DE-2</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-2] Die Gruppe "SELLER CONTACT" (BG-6) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress"
|
||||
priority="1007"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-3</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-3] Das Element "Seller city" (BT-37) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-4</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-4] Das Element "Seller post code" (BT-38) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:Contact"
|
||||
priority="1006"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:Contact"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Name[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Name[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-5</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-5] Das Element "Seller contact point" (BT-41) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:Telephone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:Telephone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-6</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-6] Das Element "Seller contact telephone number" (BT-42) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:ElectronicMail[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:ElectronicMail[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-7</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-7] Das Element "Seller contact email address" (BT-43) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="matches(normalize-space(cbc:Telephone), $XR-TELEPHONE-REGEX)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="matches(normalize-space(cbc:Telephone), $XR-TELEPHONE-REGEX)">
|
||||
<xsl:attribute name="id">BR-DE-27</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-27] In BT-42 sollen mindestens drei Ziffern enthalten sein.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="matches(normalize-space(cbc:ElectronicMail), $XR-EMAIL-REGEX)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="matches(normalize-space(cbc:ElectronicMail), $XR-EMAIL-REGEX)">
|
||||
<xsl:attribute name="id">BR-DE-28</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-28] In BT-43 soll genau ein @-Zeichen enthalten sein, welches nicht von einem Leerzeichen, einem Punkt, aber mindestens zwei Zeichen auf beiden Seiten flankiert werden soll. Ein Punkt sollte nicht am Anfang oder am Ende stehen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress"
|
||||
priority="1005"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-8</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-8] Das Element "Buyer city" (BT-52) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-9</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-9] Das Element "Buyer post code" (BT-53) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address"
|
||||
priority="1004"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:CityName[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:CityName[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-10</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-10] Das Element "Deliver to city" (BT-77) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cbc:PostalZone[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cbc:PostalZone[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-11</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-11] Das Element "Deliver to post code" (BT-78) muss übermittelt werden, wenn die Gruppe "DELIVER TO ADDRESS" (BG-15) übermittelt wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (30,58)]"
|
||||
priority="1003"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (30,58)]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:PaymentMeansCode = '58') or matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '58') or matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-19</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-19] "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PayeeFinancialAccount"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cac:PayeeFinancialAccount">
|
||||
<xsl:attribute name="id">BR-DE-23-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-23-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Überweisungen enthält (30, 58), muss BG-17 "CREDIT TRANSFER" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cac:CardAccount) and not(cac:PaymentMandate)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cac:CardAccount) and not(cac:PaymentMandate)">
|
||||
<xsl:attribute name="id">BR-DE-23-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-23-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Überweisungen enthält (30, 58), dürfen BG-18 und BG-19 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (48,54,55)]"
|
||||
priority="1002"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = (48,54,55)]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:CardAccount"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:CardAccount">
|
||||
<xsl:attribute name="id">BR-DE-24-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-24-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Kartenzahlungen enthält (48, 54, 55), muss genau BG-18 "PAYMENT CARD INFORMATION" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cac:PayeeFinancialAccount) and not(cac:PaymentMandate)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cac:PayeeFinancialAccount) and not(cac:PaymentMandate)">
|
||||
<xsl:attribute name="id">BR-DE-24-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-24-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Kartenzahlungen enthält (48, 54, 55), dürfen BG-17 und BG-19 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = 59]"
|
||||
priority="1001"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:PaymentMeans[cbc:PaymentMeansCode = 59]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cbc:PaymentMeansCode = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:decimal(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cbc:PaymentMeansCode = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:decimal(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then $cp - 55 else $cp - 48),'')) mod 97 = 1">
|
||||
<xsl:attribute name="id">BR-DE-20</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-20] "Debited account identifier" (BT-91) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 59 SEPA als Zahlungsmittel gefordert wird.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:PaymentMandate"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cac:PaymentMandate">
|
||||
<xsl:attribute name="id">BR-DE-25-a</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-25-a] Wenn BT-81 "Payment means type code" einen Schlüssel für Lastschriften enthält (59), muss genau BG-19 "DIRECT DEBIT" übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(cac:PayeeFinancialAccount) and not(cac:CardAccount)"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(cac:PayeeFinancialAccount) and not(cac:CardAccount)">
|
||||
<xsl:attribute name="id">BR-DE-25-b</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-25-b] Wenn BT-81 "Payment means type code" einen Schlüssel für Lastschriften enthält (59), dürfen BG-17 und BG-18 nicht übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal"
|
||||
priority="1000"
|
||||
mode="M8">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="cac:TaxCategory/cbc:Percent[boolean(normalize-space(.))]">
|
||||
<xsl:attribute name="id">BR-DE-14</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DE-14] Das Element "VAT category rate" (BT-119) muss übermittelt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" priority="-1" mode="M8"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M8">
|
||||
<xsl:apply-templates select="*" mode="M8"/>
|
||||
</xsl:template>
|
||||
<!--PATTERN ubl-extension-pattern-->
|
||||
<xsl:variable name="isExtension"
|
||||
select="exists(/ubl:Invoice/cbc:CustomizationID[text() = concat( 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_', $XR-MAJOR-MINOR-VERSION ,'#conformant#urn:xoev-de:kosit:extension:xrechnung_', $XR-MAJOR-MINOR-VERSION) ] )"/>
|
||||
<!--RULE -->
|
||||
<xsl:template match="cbc:EmbeddedDocumentBinaryObject[$isExtension]"
|
||||
priority="1006"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cbc:EmbeddedDocumentBinaryObject[$isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test=".[@mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml']"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test=".[@mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml']">
|
||||
<xsl:attribute name="id">BR-DEX-01</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-01] Das Element <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> "Attached Document" (BT-125) benutzt einen nicht zulässigen MIME-Code: <xsl:text/>
|
||||
<xsl:value-of select="@mimeCode"/>
|
||||
<xsl:text/>. Im Falle einer Extension darf zusätzlich zu der Liste der mime codes (definiert in Abschnitt 8.2, "Binary Object") der MIME-Code application/xml genutzt werden.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="/ubl:Invoice[$isExtension]" priority="1005" mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="/ubl:Invoice[$isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [xs:decimal(cbc:LineExtensionAmount) = sum(child::cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [xs:decimal(cbc:LineExtensionAmount) = sum(child::cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))">
|
||||
<xsl:attribute name="id">BR-DEX-02</xsl:attribute>
|
||||
<xsl:attribute name="flag">warning</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-02] Der Wert von "Invoice line net amount" (BT-131) einer "INVOICE LINE"
|
||||
(BG-25) oder einer "SUB INVOICE LINE" (BG-DEX-01) soll der Summe
|
||||
der "Invoice line net amount" (BT-131) der direkt darunterliegenden "SUB
|
||||
INVOICE LINE" (BG-DEX-01) entsprechen.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(exists(//cac:SubInvoiceLine/cac:Item[ count ( cac:ClassifiedTaxCategory) != 1]))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="not(exists(//cac:SubInvoiceLine/cac:Item[ count ( cac:ClassifiedTaxCategory) != 1]))">
|
||||
<xsl:attribute name="id">BR-DEX-03</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-03] Eine Sub Invoice Line (BG-DEX-01) muss genau eine "SUB INVOICE LINE VAT INFORMATION" (BG-DEX-06) enthalten.</svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="cac:PartyIdentification/cbc:ID[@schemeID and $isExtension]"
|
||||
priority="1004"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cac:PartyIdentification/cbc:ID[@schemeID and $isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' ')))) or ((not(contains(normalize-space(@schemeID), ' ')) and contains(' SEPA ', concat(' ', normalize-space(@schemeID), ' '))) and ((ancestor::cac:AccountingSupplierParty) or (ancestor::cac:PayeeParty)))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' ')))) or ((not(contains(normalize-space(@schemeID), ' ')) and contains(' SEPA ', concat(' ', normalize-space(@schemeID), ' '))) and ((ancestor::cac:AccountingSupplierParty) or (ancestor::cac:PayeeParty)))">
|
||||
<xsl:attribute name="id">BR-DEX-04</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-04] Any scheme identifier in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> MUST be coded using one of the ISO 6523 ICD list. </svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="cac:PartyLegalEntity/cbc:CompanyID[@schemeID and $isExtension]"
|
||||
priority="1003"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cac:PartyLegalEntity/cbc:CompanyID[@schemeID and $isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))">
|
||||
<xsl:attribute name="id">BR-DEX-05</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-05] Any scheme identifier in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> MUST be coded using one of the ISO 6523 ICD list. </svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="cac:StandardItemIdentification/cbc:ID[@schemeID and $isExtension]"
|
||||
priority="1002"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cac:StandardItemIdentification/cbc:ID[@schemeID and $isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))">
|
||||
<xsl:attribute name="id">BR-DEX-06</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-06] Any scheme identifier in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> MUST be coded using one of the ISO 6523 ICD list. </svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="cbc:EndpointID[@schemeID and $isExtension]"
|
||||
priority="1001"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cbc:EndpointID[@schemeID and $isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="((not(contains(normalize-space(@schemeID), ' ')) and contains($CEF-EAS-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="((not(contains(normalize-space(@schemeID), ' ')) and contains($CEF-EAS-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))">
|
||||
<xsl:attribute name="id">BR-DEX-07</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-07] Any scheme identifier for an Endpoint Identifier in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> MUST belong to the CEF EAS code list. </svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<!--RULE -->
|
||||
<xsl:template match="cac:DeliveryLocation/cbc:ID[@schemeID and $isExtension]"
|
||||
priority="1000"
|
||||
mode="M9">
|
||||
<svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
context="cac:DeliveryLocation/cbc:ID[@schemeID and $isExtension]"/>
|
||||
<!--ASSERT -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))"/>
|
||||
<xsl:otherwise>
|
||||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
test="((not(contains(normalize-space(@schemeID), ' ')) and contains($ISO-6523-ICD-EXT-CODES, concat(' ', normalize-space(@schemeID), ' '))))">
|
||||
<xsl:attribute name="id">BR-DEX-08</xsl:attribute>
|
||||
<xsl:attribute name="flag">fatal</xsl:attribute>
|
||||
<xsl:attribute name="location">
|
||||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</xsl:attribute>
|
||||
<svrl:text>[BR-DEX-08] Any scheme identifier for a Delivery location identifier in <xsl:text/>
|
||||
<xsl:value-of select="name(.)"/>
|
||||
<xsl:text/> MUST be coded using one of the ISO 6523 ICD list. </svrl:text>
|
||||
</svrl:failed-assert>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
<xsl:template match="text()" priority="-1" mode="M9"/>
|
||||
<xsl:template match="@*|node()" priority="-2" mode="M9">
|
||||
<xsl:apply-templates select="*" mode="M9"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user