mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
524 lines
25 KiB
XML
524 lines
25 KiB
XML
<?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:cn="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-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-2"/>
|
||
</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="XRechnung 1.1 - Schematron - 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:CreditNote-2"
|
||
prefix="cn"/>
|
||
<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">UBL-model</xsl:attribute>
|
||
<xsl:attribute name="name">UBL-model</xsl:attribute>
|
||
<xsl:apply-templates/>
|
||
</svrl:active-pattern>
|
||
<xsl:apply-templates select="/" mode="M8"/>
|
||
</svrl:schematron-output>
|
||
</xsl:template>
|
||
|
||
<!--SCHEMATRON PATTERNS-->
|
||
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">XRechnung 1.1 - Schematron - UBL - Invoice</svrl:text>
|
||
|
||
<!--PATTERN UBL-model-->
|
||
|
||
|
||
<!--RULE -->
|
||
<xsl:template match="/ubl:Invoice" priority="1007" mode="M8">
|
||
|
||
<!--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"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:BuyerReference">
|
||
<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) ist zwingend zu übermitteln.</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)"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||
test="(cac:TaxRepresentativeParty, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID)">
|
||
<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] Das Element "Seller VAT identifier" (BT-31) ist anzugeben, wenn nicht das Element "Seller tax registration identifier" (BT-32) oder eine Gruppe "SELLER TAX REPRESENTATIVE PARTY" (BG-11) angegeben wurden.</svrl:text>
|
||
</svrl:failed-assert>
|
||
</xsl:otherwise>
|
||
</xsl:choose>
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:InvoiceTypeCode = '326' or cbc:InvoiceTypeCode = '380' or cbc:InvoiceTypeCode = '384' or cbc:InvoiceTypeCode = '381'"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||
test="cbc:InvoiceTypeCode = '326' or cbc:InvoiceTypeCode = '380' or cbc:InvoiceTypeCode = '384' or cbc:InvoiceTypeCode = '381'">
|
||
<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] TODO REGEL BT-3 ggf. mit anderer ID</svrl:text>
|
||
</svrl:failed-assert>
|
||
</xsl:otherwise>
|
||
</xsl:choose>
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="every $line in tokenize(cac:PaymentTerms/cbc:Note,'\n\r?') 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 tokenize(cac:PaymentTerms/cbc:Note,'\n\r?') 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">warning</xsl:attribute>
|
||
<xsl:attribute name="location">
|
||
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||
</xsl:attribute>
|
||
<svrl:text>[BR-DE-18] TODO REGEL BT-20 ggf. mit anderer ID</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">
|
||
|
||
<!--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) ist zwingend zu übermitteln.</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">
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:CityName"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:CityName">
|
||
<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) ist zwingend zu übermitteln.</svrl:text>
|
||
</svrl:failed-assert>
|
||
</xsl:otherwise>
|
||
</xsl:choose>
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:PostalZone"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:PostalZone">
|
||
<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) ist zwingend zu übermitteln.</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">
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:Name"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:Name">
|
||
<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) ist zwingend zu übermitteln.</svrl:text>
|
||
</svrl:failed-assert>
|
||
</xsl:otherwise>
|
||
</xsl:choose>
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:Telephone"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:Telephone">
|
||
<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) ist zwingend zu übermitteln.</svrl:text>
|
||
</svrl:failed-assert>
|
||
</xsl:otherwise>
|
||
</xsl:choose>
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:ElectronicMail"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:ElectronicMail">
|
||
<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) ist zwingend zu übermitteln.</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">
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:CityName"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:CityName">
|
||
<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) ist zwingend zu übermitteln.</svrl:text>
|
||
</svrl:failed-assert>
|
||
</xsl:otherwise>
|
||
</xsl:choose>
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:PostalZone"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:PostalZone">
|
||
<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) ist zwingend zu übermitteln.</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">
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:CityName"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:CityName">
|
||
<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) ist zwingend zu übermitteln.</svrl:text>
|
||
</svrl:failed-assert>
|
||
</xsl:otherwise>
|
||
</xsl:choose>
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cbc:PostalZone"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cbc:PostalZone">
|
||
<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) ist zwingend zu übermitteln.</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">
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="count(cac:PayeeFinancialAccount[1]) + count(cac:CardAccount) + count(cac:PaymentMandate) = 1"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||
test="count(cac:PayeeFinancialAccount[1]) + count(cac:CardAccount) + count(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 einer der drei Gruppen "CREDIT TRANSFER" (BG-17), "PAYMENT CARD INFORMATION" (BG-18) oder "DIRECT DEBIT"(BG-19) gemacht 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:TaxTotal/cac:TaxSubtotal"
|
||
priority="1000"
|
||
mode="M8">
|
||
|
||
<!--ASSERT -->
|
||
<xsl:choose>
|
||
<xsl:when test="cac:TaxCategory/cbc:Percent"/>
|
||
<xsl:otherwise>
|
||
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||
test="cac:TaxCategory/cbc:Percent">
|
||
<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) ist zwingend zu übermitteln.</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>
|
||
</xsl:stylesheet>
|