added schematron XSL for most recent working drafts of tc434 and German CIUS.

This commit is contained in:
fbuettner 2017-12-12 13:52:12 +01:00
parent 470e2e5fa2
commit 087b1c590a
5 changed files with 25963 additions and 25377 deletions

File diff suppressed because one or more lines are too long

View file

@ -169,7 +169,7 @@
<!--SCHEMA SETUP-->
<xsl:template match="/">
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XRechnung 1.0 - Schematron - CII"
title="XRechnung 1.1 - Schematron - CII"
schemaVersion="">
<xsl:comment>
<xsl:value-of select="$archiveDirParameter"/>  
@ -200,7 +200,7 @@
</xsl:template>
<!--SCHEMATRON PATTERNS-->
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">XRechnung 1.0 - Schematron - CII</svrl:text>
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">XRechnung 1.1 - Schematron - CII</svrl:text>
<!--PATTERN CII-model-->
@ -226,10 +226,10 @@
<!--ASSERT -->
<xsl:choose>
<xsl:when test="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement"/>
<xsl:when test="count(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:PayeePartyCreditorFinancialAccount[1]) + count(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:ApplicableTradeSettlementFinancialCard) + count((rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID, rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID, rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:PayerPartyDebtorFinancialAccount/ram:IBANID)[1]) = 1"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
test="rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement">
test="count(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:PayeePartyCreditorFinancialAccount[1]) + count(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:ApplicableTradeSettlementFinancialCard) + count((rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID, rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:CreditorReferenceID, rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans/ram:PayerPartyDebtorFinancialAccount/ram:IBANID)[1]) = 1">
<xsl:attribute name="id">BR-DE-13</xsl:attribute>
<xsl:attribute name="flag">fatal</xsl:attribute>
<xsl:attribute name="location">
@ -267,7 +267,39 @@
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[BR-DE-16] Ein "Seller VAT identifier" (BT-31) ist anzugeben, wenn nicht ein "Seller tax registration identifier" (BT-32) oder eine eine "SELLER TAX REPRESENTATIVE PARTY" (BG-11) angegeben wurden.</svrl:text>
<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="rsm:ExchangedDocument/ram:TypeCode = '326' or rsm:ExchangedDocument/ram:TypeCode = '380' or rsm:ExchangedDocument/ram:TypeCode = '384' or rsm:ExchangedDocument/ram:TypeCode = '381'"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
test="rsm:ExchangedDocument/ram:TypeCode = '326' or rsm:ExchangedDocument/ram:TypeCode = '380' or rsm:ExchangedDocument/ram:TypeCode = '384' or rsm:ExchangedDocument/ram:TypeCode = '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(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description,'\n\r?') satisfies if(count(tokenize($line,'#')) &gt; 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(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description,'\n\r?') satisfies if(count(tokenize($line,'#')) &gt; 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>
@ -458,22 +490,6 @@
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<!--ASSERT -->
<xsl:choose>
<xsl:when test="matches(ram:PostcodeCode,'[0-9]{5}')"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
test="matches(ram:PostcodeCode,'[0-9]{5}')">
<xsl:attribute name="id">BR-DE-12</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-12] Mit dem Element "Deliver to post code" (BT-78) wird eine Postleitzahl übermittelt.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M7"/>
</xsl:template>

File diff suppressed because one or more lines are too long

View file

@ -169,7 +169,7 @@
<!--SCHEMA SETUP-->
<xsl:template match="/">
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XRechnung 1.0 - Schematron - UBL - CreditNote"
title="XRechnung 1.1 - Schematron - UBL - CreditNote"
schemaVersion="">
<xsl:comment>
<xsl:value-of select="$archiveDirParameter"/>  
@ -201,7 +201,7 @@
</xsl:template>
<!--SCHEMATRON PATTERNS-->
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">XRechnung 1.0 - Schematron - UBL - CreditNote</svrl:text>
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">XRechnung 1.1 - Schematron - UBL - CreditNote</svrl:text>
<!--PATTERN UBL-model-->
@ -250,7 +250,39 @@
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[BR-DE-16] Ein "Seller VAT identifier" (BT-31) ist anzugeben, wenn nicht ein "Seller tax registration identifier" (BT-32) oder eine eine "SELLER TAX REPRESENTATIVE PARTY" (BG-11) angegeben wurden.</svrl:text>
<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:CreditNoteTypeCode = '326' or cbc:CreditNoteTypeCode = '380' or cbc:CreditNoteTypeCode = '384' or cbc:CreditNoteTypeCode = '381'"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
test="cbc:CreditNoteTypeCode = '326' or cbc:CreditNoteTypeCode = '380' or cbc:CreditNoteTypeCode = '384' or cbc:CreditNoteTypeCode = '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,'#')) &gt; 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,'#')) &gt; 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>
@ -439,22 +471,6 @@
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<!--ASSERT -->
<xsl:choose>
<xsl:when test="matches(cbc:PostalZone,'[0-9]{5}')"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
test="matches(cbc:PostalZone,'[0-9]{5}')">
<xsl:attribute name="id">BR-DE-12</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-12] Mit dem Element "Deliver to post code" (BT-78) wird eine Postleitzahl übermittelt.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
</xsl:template>
@ -463,10 +479,10 @@
<!--ASSERT -->
<xsl:choose>
<xsl:when test="(cac:PayeeFinancialAccount, cac:CardAccount, cac:PaymentMandate)"/>
<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="(cac:PayeeFinancialAccount, cac:CardAccount, cac:PaymentMandate)">
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">

View file

@ -169,7 +169,7 @@
<!--SCHEMA SETUP-->
<xsl:template match="/">
<svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
title="XRechnung 1.0 - Schematron - UBL - Invoice"
title="XRechnung 1.1 - Schematron - UBL - Invoice"
schemaVersion="">
<xsl:comment>
<xsl:value-of select="$archiveDirParameter"/>  
@ -201,7 +201,7 @@
</xsl:template>
<!--SCHEMATRON PATTERNS-->
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">XRechnung 1.0 - Schematron - UBL - Invoice</svrl:text>
<svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">XRechnung 1.1 - Schematron - UBL - Invoice</svrl:text>
<!--PATTERN UBL-model-->
@ -250,7 +250,39 @@
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[BR-DE-16] Ein "Seller VAT identifier" (BT-31) ist anzugeben, wenn nicht ein "Seller tax registration identifier" (BT-32) oder eine eine "SELLER TAX REPRESENTATIVE PARTY" (BG-11) angegeben wurden.</svrl:text>
<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,'#')) &gt; 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,'#')) &gt; 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>
@ -439,22 +471,6 @@
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<!--ASSERT -->
<xsl:choose>
<xsl:when test="matches(cbc:PostalZone,'[0-9]{5}')"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
test="matches(cbc:PostalZone,'[0-9]{5}')">
<xsl:attribute name="id">BR-DE-12</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-12] Mit dem Element "Deliver to post code" (BT-78) wird eine Postleitzahl übermittelt.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*|comment()|processing-instruction()" mode="M8"/>
</xsl:template>
@ -463,10 +479,10 @@
<!--ASSERT -->
<xsl:choose>
<xsl:when test="(cac:PayeeFinancialAccount, cac:CardAccount, cac:PaymentMandate)"/>
<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="(cac:PayeeFinancialAccount, cac:CardAccount, cac:PaymentMandate)">
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">