Merge in validation
This commit is contained in:
parent
e9a0adf0fc
commit
1691b685ae
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,731 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- ====================================================================== -->
|
||||
<!-- ===== CCTS Core Component Type Schema Module ===== -->
|
||||
<!-- ====================================================================== -->
|
||||
<!--
|
||||
Module of Core Component Type
|
||||
Agency: UN/CEFACT
|
||||
VersionID: 1.1
|
||||
Last change: 14 January 2005
|
||||
|
||||
|
||||
|
||||
Copyright (C) UN/CEFACT (2006). All Rights Reserved.
|
||||
This document and translations of it may be copied and furnished to others,
|
||||
and derivative works that comment on or otherwise explain it or assist
|
||||
in its implementation may be prepared, copied, published and distributed,
|
||||
in whole or in part, without restriction of any kind, provided that the
|
||||
above copyright notice and this paragraph are included on all such copies
|
||||
and derivative works. However, this document itself may not be modified in
|
||||
any way, such as by removing the copyright notice or references to
|
||||
UN/CEFACT, except as needed for the purpose of developing UN/CEFACT
|
||||
specifications, in which case the procedures for copyrights defined in the
|
||||
UN/CEFACT Intellectual Property Rights document must be followed, or as
|
||||
|
||||
|
||||
required to translate it into languages other than English.
|
||||
The limited permissions granted above are perpetual and will not be revoked
|
||||
|
||||
|
||||
|
||||
by UN/CEFACT or its successors or assigns.
|
||||
This document and the information contained herein is provided on an "AS IS"
|
||||
basis and UN/CEFACT DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
|
||||
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL
|
||||
NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
|
||||
FITNESS FOR A PARTICULAR PURPOSE.
|
||||
-->
|
||||
<xsd:schema targetNamespace="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"
|
||||
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
|
||||
xmlns:cct="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<!-- ===== Type Definitions ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<!-- ===== CCT: AmountType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="AmountType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000001</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Amount. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A number of monetary units specified in a currency where the unit of the currency is explicit or implied.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Amount</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:decimal">
|
||||
<xsd:attribute name="currencyID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000001-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Amount Currency. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The currency of the amount.</ccts:Definition>
|
||||
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Reference UNECE Rec 9, using 3-letter alphabetic codes.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="currencyCodeListVersionID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000001-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Amount Currency. Code List Version. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The VersionID of the UN/ECE Rec9 code list.</ccts:Definition>
|
||||
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Code List Version</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: BinaryObjectType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="BinaryObjectType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A set of finite-length sequences of binary octets.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Binary Object</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:base64Binary">
|
||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Format. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The format of the binary content.</ccts:Definition>
|
||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Mime. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The mime type of the binary object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="encodingCode" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002-SC4</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Encoding. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>Specifies the decoding algorithm of the binary object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Encoding</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="characterSetCode" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002-SC5</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Character Set. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The character set of the binary object if the mime type is text.</ccts:Definition>
|
||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Character Set</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="uri" type="xsd:anyURI" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002-SC6</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Uniform Resource. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the binary object is located.</ccts:Definition>
|
||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="filename" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002-SC7</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Filename.Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The filename of the binary object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Filename</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: CodeType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="CodeType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A character string (letters, figures, or symbols) that for brevity and/or languange independence may be used to represent or replace a definitive value or text of an attribute together with relevant supplementary information.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Should not be used if the character string identifies an instance of an object class or an object in the real world, in which case the Identifier. Type should be used.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:normalizedString">
|
||||
<xsd:attribute name="listID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code List. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The identification of a list of codes.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="listAgencyID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code List. Agency. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>An agency that maintains one or more lists of codes.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Agency</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="listAgencyName" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC4</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code List. Agency Name. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The name of the agency that maintains the list of codes.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Agency Name</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="listName" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC5</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code List. Name. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The name of a list of codes.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="listVersionID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC6</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code List. Version. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The version of the list of codes.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Version</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="name" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC7</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code. Name. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The textual equivalent of the code content component.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="languageID" type="xsd:language" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC8</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Language. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The identifier of the language used in the code name.</ccts:Definition>
|
||||
<ccts:ObjectClass>Language</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="listURI" type="xsd:anyURI" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC9</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code List. Uniform Resource. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the code list is located.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code List</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="listSchemeURI" type="xsd:anyURI" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000007-SC10</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code List Scheme. Uniform Resource. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the code list scheme is located.</ccts:Definition>
|
||||
<ccts:ObjectClass>Code List Scheme</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: DateTimeType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="DateTimeType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000008</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Date Time. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A particular point in the progression of time together with the relevant supplementary information.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Date Time</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Can be used for a date and/or time.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:string">
|
||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000008-SC1</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Date Time. Format. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The format of the date time content</ccts:Definition>
|
||||
<ccts:ObjectClass>Date Time</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: IdentifierType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="IdentifierType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identifier. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A character string to identify and distinguish uniquely, one instance of an object in an identification scheme from all other objects in the same scheme together with relevant supplementary information.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:normalizedString">
|
||||
<xsd:attribute name="schemeID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identification Scheme. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The identification of the identification scheme.</ccts:Definition>
|
||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="schemeName" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identification Scheme. Name. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The name of the identification scheme.</ccts:Definition>
|
||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Name</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="schemeAgencyID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011-SC4</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identification Scheme Agency. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The identification of the agency that maintains the identification scheme.</ccts:Definition>
|
||||
<ccts:ObjectClass>Identification Scheme Agency</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="schemeAgencyName" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011-SC5</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identification Scheme Agency. Name. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The name of the agency that maintains the identification scheme.</ccts:Definition>
|
||||
<ccts:ObjectClass>Identification Scheme Agency</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Agency Name</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="schemeVersionID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011-SC6</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identification Scheme. Version. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The version of the identification scheme.</ccts:Definition>
|
||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Version</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="schemeDataURI" type="xsd:anyURI" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011-SC7</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identification Scheme Data. Uniform Resource. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the identification scheme data is located.</ccts:Definition>
|
||||
<ccts:ObjectClass>Identification Scheme Data</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="schemeURI" type="xsd:anyURI" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000011-SC8</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identification Scheme. Uniform Resource. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The Uniform Resource Identifier that identifies where the identification scheme is located.</ccts:Definition>
|
||||
<ccts:ObjectClass>Identification Scheme</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Uniform Resource Identifier</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: IndicatorType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="IndicatorType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000012</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Indicator. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A list of two mutually exclusive Boolean values that express the only possible states of a Property.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Indicator</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:string">
|
||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000012-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Indicator. Format. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>Whether the indicator is numeric, textual or binary.</ccts:Definition>
|
||||
<ccts:ObjectClass>Indicator</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: MeasureType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="MeasureType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000013</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Measure. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A numeric value determined by measuring an object along with the specified unit of measure.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Measure</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:decimal">
|
||||
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000013-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Measure Unit. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The type of unit of measure.</ccts:Definition>
|
||||
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Code</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Reference UNECE Rec. 20 and X12 355</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="unitCodeListVersionID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000013-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Measure Unit. Code List Version. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The version of the measure unit code list.</ccts:Definition>
|
||||
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Code List Version</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: NumericType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="NumericType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000014</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Numeric. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Numeric</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:decimal">
|
||||
<xsd:attribute name="format" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000014-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Numeric. Format. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>Whether the number is an integer, decimal, real number or percentage.</ccts:Definition>
|
||||
<ccts:ObjectClass>Numeric</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Format</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: QuantityType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="QuantityType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000018</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Quantity. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A counted number of non-monetary units possibly including fractions.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Quantity</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:decimal">
|
||||
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000018-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Quantity. Unit. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The unit of the quantity</ccts:Definition>
|
||||
<ccts:ObjectClass>Quantity</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Unit Code</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="unitCodeListID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000018-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Quantity Unit. Code List. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The quantity unit code list.</ccts:Definition>
|
||||
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Code List</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="unitCodeListAgencyID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000018-SC4</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Quantity Unit. Code List Agency. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The identification of the agency that maintains the quantity unit code list</ccts:Definition>
|
||||
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Code List Agency</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Defaults to the UN/EDIFACT data element 3055 code list.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="unitCodeListAgencyName" type="xsd:string" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000018-SC5</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Quantity Unit. Code List Agency Name. Text</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The name of the agency which maintains the quantity unit code list.</ccts:Definition>
|
||||
<ccts:ObjectClass>Quantity Unit</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Code List Agency Name</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- ===== CCT: TextType ===== -->
|
||||
<!-- =================================================================== -->
|
||||
<xsd:complexType name="TextType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000019</ccts:UniqueID>
|
||||
<ccts:CategoryCode>CCT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Text. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A character string (i.e. a finite set of characters) generally in the form of words of a language.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:string">
|
||||
<xsd:attribute name="languageID" type="xsd:language" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000019-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Language. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The identifier of the language used in the content component.</ccts:Definition>
|
||||
<ccts:ObjectClass>Language</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="languageLocaleID" type="xsd:normalizedString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000019-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName> Language. Locale. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The identification of the locale of the language.</ccts:Definition>
|
||||
<ccts:ObjectClass>Language</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Locale</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,223 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-CommonExtensionComponents-2.1.xsd
|
||||
Generated on: 2013-04-20 18:40(UTC)
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
-->
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
elementFormDefault="qualified" attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
<!-- ===== Imports ===== -->
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2" schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd"/>
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemaLocation="UBL-CommonBasicComponents-2.1.xsd"/>
|
||||
<!-- ===== Includes ===== -->
|
||||
<xsd:include schemaLocation="UBL-ExtensionContentDataType-2.1.xsd"/>
|
||||
<!-- ===== Aggregate Element and Type Declarations ===== -->
|
||||
<xsd:element name="UBLExtensions" type="UBLExtensionsType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A container for all extensions present in the document.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:complexType name="UBLExtensionsType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A container for all extensions present in the document.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="UBLExtension" minOccurs="1" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A single extension for private use.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="UBLExtension" type="UBLExtensionType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A single extension for private use.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:complexType name="UBLExtensionType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A single extension for private use.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="cbc:ID" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
An identifier for the Extension assigned by the creator of the extension.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="cbc:Name" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A name for the Extension assigned by the creator of the extension.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionAgencyID" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
An agency that maintains one or more Extensions.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionAgencyName" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The name of the agency that maintains the Extension.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionVersionID" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The version of the Extension.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionAgencyURI" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A URI for the Agency that maintains the Extension.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionURI" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A URI for the Extension.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionReasonCode" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A code for reason the Extension is being included.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionReason" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
A description of the reason for the Extension.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ExtensionContent" minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The definition of the extension content.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- ===== Basic Element and Type Declarations ===== -->
|
||||
<xsd:element name="ExtensionAgencyID" type="ExtensionAgencyIDType"/>
|
||||
<xsd:element name="ExtensionAgencyName" type="ExtensionAgencyNameType"/>
|
||||
<xsd:element name="ExtensionAgencyURI" type="ExtensionAgencyURIType"/>
|
||||
<xsd:element name="ExtensionContent" type="ExtensionContentType"/>
|
||||
<xsd:element name="ExtensionReason" type="ExtensionReasonType"/>
|
||||
<xsd:element name="ExtensionReasonCode" type="ExtensionReasonCodeType"/>
|
||||
<xsd:element name="ExtensionURI" type="ExtensionURIType"/>
|
||||
<xsd:element name="ExtensionVersionID" type="ExtensionVersionIDType"/>
|
||||
<xsd:complexType name="ExtensionAgencyIDType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:IdentifierType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ExtensionAgencyNameType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:TextType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ExtensionAgencyURIType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:IdentifierType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ExtensionReasonType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:TextType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ExtensionReasonCodeType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:CodeType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ExtensionURIType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:IdentifierType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ExtensionVersionIDType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:IdentifierType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
<!-- ===== Copyright Notice ===== -->
|
||||
<!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: xsd/common/UBL-CommonSignatureComponents-2.1.xsd
|
||||
Generated on: 2013-10-31 17:18z
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
-->
|
||||
<xsd:schema xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
|
||||
xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
|
||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
<!-- ===== Imports ===== -->
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
||||
schemaLocation="UBL-SignatureAggregateComponents-2.1.xsd"/>
|
||||
<!-- ===== Element Declarations ===== -->
|
||||
<xsd:element name="UBLDocumentSignatures" type="UBLDocumentSignaturesType"/>
|
||||
<!-- ===== Type Definitions ===== -->
|
||||
<!-- ===== Aggregate Business Information Entity Type Definitions ===== -->
|
||||
<xsd:complexType name="UBLDocumentSignaturesType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<ccts:Component>
|
||||
<ccts:ComponentType>ABIE</ccts:ComponentType>
|
||||
<ccts:DictionaryEntryName>UBL Document Signatures. Details</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>This class collects all signature information for a document.</ccts:Definition>
|
||||
<ccts:ObjectClass>UBL Document Signatures</ccts:ObjectClass>
|
||||
</ccts:Component>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="sac:SignatureInformation" minOccurs="1" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<ccts:Component>
|
||||
<ccts:ComponentType>ASBIE</ccts:ComponentType>
|
||||
<ccts:DictionaryEntryName>UBL Document Signatures. Signature Information</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>Each of these is scaffolding for a single digital signature.</ccts:Definition>
|
||||
<ccts:Cardinality>1..n</ccts:Cardinality>
|
||||
<ccts:ObjectClass>UBL Document Signatures</ccts:ObjectClass>
|
||||
<ccts:PropertyTerm>Signature Information</ccts:PropertyTerm>
|
||||
<ccts:AssociatedObjectClass>Signature Information</ccts:AssociatedObjectClass>
|
||||
<ccts:RepresentationTerm>Signature Information</ccts:RepresentationTerm>
|
||||
</ccts:Component>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
<!-- ===== Copyright Notice ===== --><!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-CoreComponentParameters-2.1.xsd
|
||||
Generated on: 2013-04-20 18:40(UTC)
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
-->
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:documentation:2"
|
||||
xmlns="urn:un:unece:uncefact:documentation:2"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
</xsd:schema>
|
||||
<!-- ===== Copyright Notice ===== -->
|
||||
<!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-ExtensionContentDataType-2.1.xsd
|
||||
Generated on: 2013-04-20 18:40(UTC)
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
-->
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns=
|
||||
"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
targetNamespace=
|
||||
"urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
|
||||
<!--import here all extension schemas-->
|
||||
<xsd:import namespace=
|
||||
"urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2"
|
||||
schemaLocation="UBL-CommonSignatureComponents-2.1.xsd"/>
|
||||
|
||||
<!-- ===== Type Declaration ===== -->
|
||||
<xsd:complexType name="ExtensionContentType">
|
||||
<xsd:sequence>
|
||||
<xsd:any namespace="##other" processContents="lax"
|
||||
minOccurs="1" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Any element in any namespace other than the UBL extension
|
||||
namespace is allowed to be the apex element of an extension.
|
||||
Only those elements found in the UBL schemas and in the
|
||||
trees of schemas imported in this module are validated.
|
||||
Any element for which there is no schema declaration in any
|
||||
of the trees of schemas passes validation and is not
|
||||
treated as a schema constraint violation.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:any>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
<!-- ===== Copyright Notice ===== -->
|
||||
<!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-QualifiedDataTypes-2.1.xsd
|
||||
Generated on: 2013-04-20 18:40(UTC)
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
-->
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
|
||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
|
||||
xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
||||
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
<!-- ===== Imports ===== -->
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2" schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd"/>
|
||||
<!-- ===== Type Definitions ===== -->
|
||||
<!--no qualified data types defined at this time-->
|
||||
</xsd:schema>
|
||||
<!-- ===== Copyright Notice ===== -->
|
||||
<!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: xsd/common/UBL-SignatureAggregateComponents-2.1.xsd
|
||||
Generated on: 2013-10-31 17:18z
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
-->
|
||||
<xsd:schema xmlns="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
||||
xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
||||
xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
||||
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
|
||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
<!-- ===== Imports ===== -->
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
||||
schemaLocation="UBL-SignatureBasicComponents-2.1.xsd"/>
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
schemaLocation="UBL-CommonBasicComponents-2.1.xsd"/>
|
||||
|
||||
<!-- ===== Incorporate W3C signature specification-->
|
||||
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#"
|
||||
schemaLocation="UBL-xmldsig-core-schema-2.1.xsd"/>
|
||||
|
||||
<!-- ===== Incorporate ETSI signature specifications-->
|
||||
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#"
|
||||
schemaLocation="UBL-XAdESv132-2.1.xsd"/>
|
||||
<xsd:import namespace="http://uri.etsi.org/01903/v1.4.1#"
|
||||
schemaLocation="UBL-XAdESv141-2.1.xsd"/>
|
||||
|
||||
<!-- ===== Element Declarations ===== -->
|
||||
<xsd:element name="SignatureInformation" type="SignatureInformationType"/>
|
||||
<!-- ===== Type Definitions ===== -->
|
||||
<!-- ===== Aggregate Business Information Entity Type Definitions ===== -->
|
||||
<xsd:complexType name="SignatureInformationType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<ccts:Component>
|
||||
<ccts:ComponentType>ABIE</ccts:ComponentType>
|
||||
<ccts:DictionaryEntryName>Signature Information. Details</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>This class captures a single signature and optionally associates to a signature in the document with the corresponding identifier.</ccts:Definition>
|
||||
<ccts:ObjectClass>Signature Information</ccts:ObjectClass>
|
||||
</ccts:Component>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="cbc:ID" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<ccts:Component>
|
||||
<ccts:ComponentType>BBIE</ccts:ComponentType>
|
||||
<ccts:DictionaryEntryName>Signature Information. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>This specifies the identifier of the signature distinguishing it from other signatures.</ccts:Definition>
|
||||
<ccts:Cardinality>0..1</ccts:Cardinality>
|
||||
<ccts:ObjectClass>Signature Information</ccts:ObjectClass>
|
||||
<ccts:PropertyTerm>Identifier</ccts:PropertyTerm>
|
||||
<ccts:RepresentationTerm>Identifier</ccts:RepresentationTerm>
|
||||
<ccts:DataType>Identifier. Type</ccts:DataType>
|
||||
</ccts:Component>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="sbc:ReferencedSignatureID" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<ccts:Component>
|
||||
<ccts:ComponentType>BBIE</ccts:ComponentType>
|
||||
<ccts:DictionaryEntryName>Signature Information. Referenced Signature Identifier. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>This associates this signature with the identifier of a signature business object in the document.</ccts:Definition>
|
||||
<ccts:Cardinality>0..1</ccts:Cardinality>
|
||||
<ccts:ObjectClass>Signature Information</ccts:ObjectClass>
|
||||
<ccts:PropertyTerm>Referenced Signature Identifier</ccts:PropertyTerm>
|
||||
<ccts:RepresentationTerm>Identifier</ccts:RepresentationTerm>
|
||||
<ccts:DataType>Identifier. Type</ccts:DataType>
|
||||
</ccts:Component>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element ref="ds:Signature" minOccurs="0" maxOccurs="1">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>This is a single digital signature as defined by the W3C specification.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
<!-- ===== Copyright Notice ===== --><!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: xsd/common/UBL-SignatureBasicComponents-2.1.xsd
|
||||
Generated on: 2013-10-31 17:18z
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
-->
|
||||
<xsd:schema xmlns="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
||||
xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
|
||||
xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
<!-- ===== Imports ===== -->
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2"
|
||||
schemaLocation="UBL-QualifiedDataTypes-2.1.xsd"/>
|
||||
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
||||
schemaLocation="UBL-UnqualifiedDataTypes-2.1.xsd"/>
|
||||
<!-- ===== Element Declarations ===== -->
|
||||
<xsd:element name="ReferencedSignatureID" type="ReferencedSignatureIDType"/>
|
||||
<!-- ===== Type Definitions ===== -->
|
||||
<!-- ===== Basic Business Information Entity Type Definitions ===== -->
|
||||
<xsd:complexType name="ReferencedSignatureIDType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="udt:IdentifierType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
<!-- ===== Copyright Notice ===== --><!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,553 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-UnqualifiedDataTypes-2.1.xsd
|
||||
Generated on: 2013-04-20 18:40(UTC)
|
||||
Copyright (c) OASIS Open 2013. All Rights Reserved.
|
||||
|
||||
This schema fragment implements UBL unqualified datatypes using core
|
||||
component types with all supplementary components as described in
|
||||
CCTS 2.01 http://www.unece.org/cefact/ebxml/CCTS_V2-01_Final.pdf tables
|
||||
8-1, 8-2 and 8-3.
|
||||
|
||||
Per table 8-3, the graphic, picture, sound and video types are based on
|
||||
"Binary Object. Type" as they are secondary representation terms.
|
||||
|
||||
Per table 8-3, the value, rate and percentage types are based on
|
||||
"Numeric. Type" as they are secondary representation terms.
|
||||
|
||||
Per table 8-3, the name type is based on "Text. Type" as it is a
|
||||
secondary representation term.
|
||||
|
||||
Per XSD lexical constraints, the following unqualified data types
|
||||
corresponding to core component types and secondary representation terms
|
||||
are based on XSD types (accordingly, the supplementary component "format"
|
||||
is not made available for these types):
|
||||
|
||||
Date Time. Type on xsd:dateTime
|
||||
Date. Type on xsd:date
|
||||
Time. Type on xsd:time
|
||||
Indicator. Type on xsd:boolean
|
||||
|
||||
Per UBL 2.0 the following supplementary components are restricted to be
|
||||
required rather than optional:
|
||||
|
||||
Amount. Currency. Identifier as (AmountType)/@currencyID
|
||||
Binary Object. Mime. Code as (BinaryObjectType)/@mimeCode
|
||||
Graphic. Mime. Code as (GraphicType)/@mimeCode
|
||||
Picture. Mime. Code as (PictureType)/@mimeCode
|
||||
Sound. Mime. Code as (SoundType)/@mimeCode
|
||||
Video. Mime. Code as (VideoType)/@mimeCode
|
||||
Measure. Unit. Code as (MeasureType)/@unitCode
|
||||
|
||||
All other unqualified data types inherit the core component types complete
|
||||
with their supplementary components.
|
||||
-->
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"
|
||||
xmlns:ccts-cct="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"
|
||||
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified"
|
||||
version="2.1">
|
||||
<!-- ===== Imports ===== -->
|
||||
<xsd:import schemaLocation="CCTS_CCT_SchemaModule-2.1.xsd"
|
||||
namespace="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2"/>
|
||||
<!-- ===== Type Definitions ===== -->
|
||||
<xsd:complexType name="AmountType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000001</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Amount. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A number of monetary units specified using a given unit of currency.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Amount</ccts:RepresentationTermName>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="ccts-cct:AmountType">
|
||||
<xsd:attribute name="currencyID" type="xsd:normalizedString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000001-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Amount. Currency. Identifier</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The currency of the amount.</ccts:Definition>
|
||||
<ccts:ObjectClass>Amount Currency</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Identification</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Reference UNECE Rec 9, using 3-letter alphabetic codes.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="BinaryObjectType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000002</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A set of finite-length sequences of binary octets.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Binary Object</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000002-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Binary Object. Mime. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The mime type of the binary object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Binary Object</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="GraphicType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000003</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Graphic. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A diagram, graph, mathematical curve, or similar representation.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Graphic</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000003-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Graphic. Mime. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The mime type of the graphic object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Graphic</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="PictureType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000004</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Picture. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A diagram, graph, mathematical curve, or similar representation.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Picture</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000004-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Picture. Mime. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The mime type of the picture object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Picture</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="SoundType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000005</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Sound. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>An audio representation.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Sound</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000005-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Sound. Mime. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The mime type of the sound object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Sound</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="VideoType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000006</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Video. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A video representation.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Video</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>binary</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="ccts-cct:BinaryObjectType">
|
||||
<xsd:attribute name="mimeCode" type="xsd:normalizedString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000006-SC3</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Video. Mime. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The mime type of the video object.</ccts:Definition>
|
||||
<ccts:ObjectClass>Video</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Mime</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="CodeType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000007</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Code. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A character string (letters, figures, or symbols) that for brevity and/or language independence may be used to represent or replace a definitive value or text of an attribute, together with relevant supplementary information.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Other supplementary components in the CCT are captured as part of the token and name for the schema module containing the code list and thus, are not declared as attributes. </ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:CodeType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="DateTimeType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000008</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Date Time. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A particular point in the progression of time, together with relevant supplementary information.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Date Time</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Can be used for a date and/or time.</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:dateTime"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="DateType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT000009</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Date. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>One calendar day according the Gregorian calendar.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Date</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:date"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TimeType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000010</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Time. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>An instance of time that occurs every day.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Time</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:time"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="IdentifierType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000011</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Identifier. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A character string to identify and uniquely distinguish one instance of an object in an identification scheme from all other objects in the same scheme, together with relevant supplementary information.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Identifier</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Other supplementary components in the CCT are captured as part of the token and name for the schema module containing the identifier list and thus, are not declared as attributes. </ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:IdentifierType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="IndicatorType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000012</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Indicator. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A list of two mutually exclusive Boolean values that express the only possible states of a property.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Indicator</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:boolean"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="MeasureType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000013</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Measure. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A numeric value determined by measuring an object using a specified unit of measure.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Measure</ccts:RepresentationTermName>
|
||||
<ccts:PropertyTermName>Type</ccts:PropertyTermName>
|
||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:restriction base="ccts-cct:MeasureType">
|
||||
<xsd:attribute name="unitCode" type="xsd:normalizedString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UNDT000013-SC2</ccts:UniqueID>
|
||||
<ccts:CategoryCode>SC</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Measure. Unit. Code</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>The type of unit of measure.</ccts:Definition>
|
||||
<ccts:ObjectClass>Measure Unit</ccts:ObjectClass>
|
||||
<ccts:PropertyTermName>Code</ccts:PropertyTermName>
|
||||
<ccts:RepresentationTermName>Code</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>normalizedString</ccts:PrimitiveType>
|
||||
<ccts:UsageRule>Reference UNECE Rec. 20 and X12 355</ccts:UsageRule>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="NumericType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000014</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Numeric. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Numeric</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:NumericType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="ValueType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000015</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:DictionaryEntryName>Value. Type</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Value</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:NumericType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="PercentType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000016</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:DictionaryEntryName>Percent. Type</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>Numeric information that is assigned or is determined by calculation, counting, or sequencing and is expressed as a percentage. It does not require a unit of quantity or unit of measure.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Percent</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:NumericType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="RateType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000017</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:DictionaryEntryName>Rate. Type</ccts:DictionaryEntryName>
|
||||
<ccts:Definition>A numeric expression of a rate that is assigned or is determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Rate</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:NumericType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="QuantityType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000018</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Quantity. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A counted number of non-monetary units, possibly including a fractional part.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Quantity</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>decimal</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:QuantityType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="TextType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000019</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Text. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A character string (i.e. a finite set of characters), generally in the form of words of a language.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Text</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:TextType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="NameType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en">
|
||||
<ccts:UniqueID>UBLUDT0000020</ccts:UniqueID>
|
||||
<ccts:CategoryCode>UDT</ccts:CategoryCode>
|
||||
<ccts:DictionaryEntryName>Name. Type</ccts:DictionaryEntryName>
|
||||
<ccts:VersionID>1.0</ccts:VersionID>
|
||||
<ccts:Definition>A character string that constitutes the distinctive designation of a person, place, thing or concept.</ccts:Definition>
|
||||
<ccts:RepresentationTermName>Name</ccts:RepresentationTermName>
|
||||
<ccts:PrimitiveType>string</ccts:PrimitiveType>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="ccts-cct:TextType"/>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
</xsd:schema><!-- ===== Copyright Notice ===== --><!--
|
||||
OASIS takes no position regarding the validity or scope of any
|
||||
intellectual property or other rights that might be claimed to pertain
|
||||
to the implementation or use of the technology described in this
|
||||
document or the extent to which any license under such rights
|
||||
might or might not be available; neither does it represent that it has
|
||||
made any effort to identify any such rights. Information on OASIS's
|
||||
procedures with respect to rights in OASIS specifications can be
|
||||
found at the OASIS website. Copies of claims of rights made
|
||||
available for publication and any assurances of licenses to be made
|
||||
available, or the result of an attempt made to obtain a general
|
||||
license or permission for the use of such proprietary rights by
|
||||
implementors or users of this specification, can be obtained from
|
||||
the OASIS Executive Director.
|
||||
|
||||
OASIS invites any interested party to bring to its attention any
|
||||
copyrights, patents or patent applications, or other proprietary
|
||||
rights which may cover technology that may be required to
|
||||
implement this specification. Please address the information to the
|
||||
OASIS Executive Director.
|
||||
|
||||
This document and translations of it may be copied and furnished to
|
||||
others, and derivative works that comment on or otherwise explain
|
||||
it or assist in its implementation may be prepared, copied,
|
||||
published and distributed, in whole or in part, without restriction of
|
||||
any kind, provided that the above copyright notice and this
|
||||
paragraph are included on all such copies and derivative works.
|
||||
However, this document itself may not be modified in any way,
|
||||
such as by removing the copyright notice or references to OASIS,
|
||||
except as needed for the purpose of developing OASIS
|
||||
specifications, in which case the procedures for copyrights defined
|
||||
in the OASIS Intellectual Property Rights document must be
|
||||
followed, or as required to translate it into languages other than
|
||||
English.
|
||||
|
||||
The limited permissions granted above are perpetual and will not be
|
||||
revoked by OASIS or its successors or assigns.
|
||||
|
||||
This document and the information contained herein is provided on
|
||||
an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
|
||||
WARRANTY THAT THE USE OF THE INFORMATION HEREIN
|
||||
WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
-->
|
||||
|
|
@ -0,0 +1,476 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-XAdESv132-2.1.xsd
|
||||
Generated on: 2011-02-21 17:20(UTC)
|
||||
|
||||
This is a copy of http://uri.etsi.org/01903/v1.3.2/XAdES.xsd modified
|
||||
only to change the importing URI for the XML DSig schema.
|
||||
-->
|
||||
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.3.2#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://uri.etsi.org/01903/v1.3.2#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified">
|
||||
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="UBL-xmldsig-core-schema-2.1.xsd"/>
|
||||
<!-- Start auxiliary types definitions: AnyType, ObjectIdentifierType,
|
||||
EncapsulatedPKIDataType and containers for time-stamp tokens -->
|
||||
<!-- Start AnyType -->
|
||||
<xsd:element name="Any" type="AnyType"/>
|
||||
<xsd:complexType name="AnyType" mixed="true">
|
||||
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:any namespace="##any" processContents="lax"/>
|
||||
</xsd:sequence>
|
||||
<xsd:anyAttribute namespace="##any"/>
|
||||
</xsd:complexType>
|
||||
<!-- End AnyType -->
|
||||
<!-- Start ObjectIdentifierType-->
|
||||
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType"/>
|
||||
<xsd:complexType name="ObjectIdentifierType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Identifier" type="IdentifierType"/>
|
||||
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="IdentifierType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:anyURI">
|
||||
<xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<xsd:simpleType name="QualifierType">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="OIDAsURI"/>
|
||||
<xsd:enumeration value="OIDAsURN"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
<xsd:complexType name="DocumentationReferencesType">
|
||||
<xsd:sequence maxOccurs="unbounded">
|
||||
<xsd:element name="DocumentationReference" type="xsd:anyURI"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End ObjectIdentifierType-->
|
||||
<!-- Start EncapsulatedPKIDataType-->
|
||||
<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType"/>
|
||||
<xsd:complexType name="EncapsulatedPKIDataType">
|
||||
<xsd:simpleContent>
|
||||
<xsd:extension base="xsd:base64Binary">
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
<xsd:attribute name="Encoding" type="xsd:anyURI" use="optional"/>
|
||||
</xsd:extension>
|
||||
</xsd:simpleContent>
|
||||
</xsd:complexType>
|
||||
<!-- End EncapsulatedPKIDataType -->
|
||||
<!-- Start time-stamp containers types -->
|
||||
<!-- Start GenericTimeStampType -->
|
||||
<xsd:element name="Include" type="IncludeType"/>
|
||||
<xsd:complexType name="IncludeType">
|
||||
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
|
||||
<xsd:attribute name="referencedData" type="xsd:boolean" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="ReferenceInfo" type="ReferenceInfoType"/>
|
||||
<xsd:complexType name="ReferenceInfoType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="ds:DigestMethod"/>
|
||||
<xsd:element ref="ds:DigestValue"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="GenericTimeStampType" abstract="true">
|
||||
<xsd:sequence>
|
||||
<xsd:choice minOccurs="0">
|
||||
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
|
||||
</xsd:choice>
|
||||
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
|
||||
<xsd:element name="XMLTimeStamp" type="AnyType"/>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End GenericTimeStampType -->
|
||||
<!-- Start XAdESTimeStampType -->
|
||||
<xsd:element name="XAdESTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:complexType name="XAdESTimeStampType">
|
||||
<xsd:complexContent>
|
||||
<xsd:restriction base="GenericTimeStampType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
|
||||
<xsd:element name="XMLTimeStamp" type="AnyType"/>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:restriction>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
<!-- End XAdESTimeStampType -->
|
||||
<!-- Start OtherTimeStampType -->
|
||||
<xsd:element name="OtherTimeStamp" type="OtherTimeStampType"/>
|
||||
<xsd:complexType name="OtherTimeStampType">
|
||||
<xsd:complexContent>
|
||||
<xsd:restriction base="GenericTimeStampType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
|
||||
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
|
||||
<xsd:choice>
|
||||
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
|
||||
<xsd:element name="XMLTimeStamp" type="AnyType"/>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:restriction>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
<!-- End OtherTimeStampType -->
|
||||
<!-- End time-stamp containers types -->
|
||||
<!-- End auxiliary types definitions-->
|
||||
<!-- Start container types -->
|
||||
<!-- Start QualifyingProperties -->
|
||||
<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType"/>
|
||||
<xsd:complexType name="QualifyingPropertiesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0"/>
|
||||
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Target" type="xsd:anyURI" use="required"/>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End QualifyingProperties -->
|
||||
<!-- Start SignedProperties-->
|
||||
<xsd:element name="SignedProperties" type="SignedPropertiesType"/>
|
||||
<xsd:complexType name="SignedPropertiesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" minOccurs="0"/>
|
||||
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End SignedProperties-->
|
||||
<!-- Start UnsignedProperties-->
|
||||
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType"/>
|
||||
<xsd:complexType name="UnsignedPropertiesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0"/>
|
||||
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End UnsignedProperties-->
|
||||
<!-- Start SignedSignatureProperties-->
|
||||
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
|
||||
<xsd:complexType name="SignedSignaturePropertiesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="SigningTime" type="xsd:dateTime" minOccurs="0"/>
|
||||
<xsd:element name="SigningCertificate" type="CertIDListType" minOccurs="0"/>
|
||||
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" minOccurs="0"/>
|
||||
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0"/>
|
||||
<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End SignedSignatureProperties-->
|
||||
<!-- Start SignedDataObjectProperties-->
|
||||
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType"/>
|
||||
<xsd:complexType name="SignedDataObjectPropertiesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End SignedDataObjectProperties-->
|
||||
<!-- Start UnsignedSignatureProperties-->
|
||||
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType"/>
|
||||
<xsd:complexType name="UnsignedSignaturePropertiesType">
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
|
||||
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
|
||||
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
|
||||
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
|
||||
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
|
||||
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
|
||||
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
|
||||
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
|
||||
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
|
||||
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:any namespace="##other"/>
|
||||
</xsd:choice>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End UnsignedSignatureProperties-->
|
||||
<!-- Start UnsignedDataObjectProperties-->
|
||||
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType"/>
|
||||
<xsd:complexType name="UnsignedDataObjectPropertiesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="UnsignedDataObjectProperty" type="AnyType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End UnsignedDataObjectProperties-->
|
||||
<!-- Start QualifyingPropertiesReference-->
|
||||
<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType"/>
|
||||
<xsd:complexType name="QualifyingPropertiesReferenceType">
|
||||
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End QualifyingPropertiesReference-->
|
||||
<!-- End container types -->
|
||||
<!-- Start SigningTime element -->
|
||||
<xsd:element name="SigningTime" type="xsd:dateTime"/>
|
||||
<!-- End SigningTime element -->
|
||||
<!-- Start SigningCertificate -->
|
||||
<xsd:element name="SigningCertificate" type="CertIDListType"/>
|
||||
<xsd:complexType name="CertIDListType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="CertIDType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CertDigest" type="DigestAlgAndValueType"/>
|
||||
<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="DigestAlgAndValueType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="ds:DigestMethod"/>
|
||||
<xsd:element ref="ds:DigestValue"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End SigningCertificate -->
|
||||
<!-- Start SignaturePolicyIdentifier -->
|
||||
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
|
||||
<xsd:complexType name="SignaturePolicyIdentifierType">
|
||||
<xsd:choice>
|
||||
<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType"/>
|
||||
<xsd:element name="SignaturePolicyImplied"/>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="SignaturePolicyIdType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="SigPolicyId" type="ObjectIdentifierType"/>
|
||||
<xsd:element ref="ds:Transforms" minOccurs="0"/>
|
||||
<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/>
|
||||
<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="SigPolicyQualifiersListType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="SPURI" type="xsd:anyURI"/>
|
||||
<xsd:element name="SPUserNotice" type="SPUserNoticeType"/>
|
||||
<xsd:complexType name="SPUserNoticeType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0"/>
|
||||
<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="NoticeReferenceType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Organization" type="xsd:string"/>
|
||||
<xsd:element name="NoticeNumbers" type="IntegerListType"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="IntegerListType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End SignaturePolicyIdentifier -->
|
||||
<!-- Start CounterSignature -->
|
||||
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
|
||||
<xsd:complexType name="CounterSignatureType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="ds:Signature"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End CounterSignature -->
|
||||
<!-- Start DataObjectFormat -->
|
||||
<xsd:element name="DataObjectFormat" type="DataObjectFormatType"/>
|
||||
<xsd:complexType name="DataObjectFormatType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0"/>
|
||||
<xsd:element name="MimeType" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required"/>
|
||||
</xsd:complexType>
|
||||
<!-- End DataObjectFormat -->
|
||||
<!-- Start CommitmentTypeIndication -->
|
||||
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>
|
||||
<xsd:complexType name="CommitmentTypeIndicationType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
|
||||
<xsd:choice>
|
||||
<xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded"/>
|
||||
<xsd:element name="AllSignedDataObjects"/>
|
||||
</xsd:choice>
|
||||
<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="CommitmentTypeQualifiersListType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End CommitmentTypeIndication -->
|
||||
<!-- Start SignatureProductionPlace -->
|
||||
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType"/>
|
||||
<xsd:complexType name="SignatureProductionPlaceType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="City" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="PostalCode" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="CountryName" type="xsd:string" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End SignatureProductionPlace -->
|
||||
<!-- Start SignerRole -->
|
||||
<xsd:element name="SignerRole" type="SignerRoleType"/>
|
||||
<xsd:complexType name="SignerRoleType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0"/>
|
||||
<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ClaimedRolesListType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="CertifiedRolesListType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End SignerRole -->
|
||||
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
|
||||
<!-- Start CompleteCertificateRefs -->
|
||||
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
|
||||
<xsd:complexType name="CompleteCertificateRefsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CertRefs" type="CertIDListType"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End CompleteCertificateRefs -->
|
||||
<!-- Start CompleteRevocationRefs-->
|
||||
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
|
||||
<xsd:complexType name="CompleteRevocationRefsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0"/>
|
||||
<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0"/>
|
||||
<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="CRLRefsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="CRLRefType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType"/>
|
||||
<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="CRLIdentifierType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Issuer" type="xsd:string"/>
|
||||
<xsd:element name="IssueTime" type="xsd:dateTime"/>
|
||||
<xsd:element name="Number" type="xsd:integer" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="OCSPRefsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="OCSPRefType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType"/>
|
||||
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="ResponderIDType">
|
||||
<xsd:choice>
|
||||
<xsd:element name="ByName" type="xsd:string"/>
|
||||
<xsd:element name="ByKey" type="xsd:base64Binary"/>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="OCSPIdentifierType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="ResponderID" type="ResponderIDType"/>
|
||||
<xsd:element name="ProducedAt" type="xsd:dateTime"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="OtherCertStatusRefsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End CompleteRevocationRefs-->
|
||||
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
|
||||
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
|
||||
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
|
||||
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
|
||||
<!-- Start CertificateValues -->
|
||||
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
|
||||
<xsd:complexType name="CertificateValuesType">
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType"/>
|
||||
<xsd:element name="OtherCertificate" type="AnyType"/>
|
||||
</xsd:choice>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<!-- End CertificateValues -->
|
||||
<!-- Start RevocationValues-->
|
||||
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
|
||||
<xsd:complexType name="RevocationValuesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0"/>
|
||||
<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0"/>
|
||||
<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0"/>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="CRLValuesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="OCSPValuesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="OtherCertStatusValuesType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<!-- End RevocationValues-->
|
||||
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
|
||||
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
|
||||
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
|
||||
</xsd:schema>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-XAdESv141-2.1.xsd
|
||||
Generated on: 2011-02-21 17:20(UTC)
|
||||
|
||||
This is a copy of http://uri.etsi.org/01903/v1.4.1/XAdESv141.xsd modified
|
||||
only to change the importing URI for the XAdES v1.3.2 schema.
|
||||
-->
|
||||
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.4.1#" xmlns="http://uri.etsi.org/01903/v1.4.1#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" elementFormDefault="qualified">
|
||||
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="UBL-XAdESv132-2.1.xsd"/>
|
||||
<!-- Start CertificateValues -->
|
||||
<xsd:element name="TimeStampValidationData" type="ValidationDataType"/>
|
||||
<xsd:complexType name="ValidationDataType">
|
||||
<xsd:sequence>
|
||||
<xsd:element ref="xades:CertificateValues" minOccurs="0" />
|
||||
<xsd:element ref="xades:RevocationValues" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
|
||||
<xsd:attribute name="UR" type="xsd:anyURI" use="optional"/>
|
||||
</xsd:complexType>
|
||||
<xsd:element name="ArchiveTimeStampV2" type="xades:XAdESTimeStampType"/>
|
||||
</xsd:schema>
|
||||
|
|
@ -0,0 +1,330 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Library: OASIS Universal Business Language (UBL) 2.1 OS
|
||||
http://docs.oasis-open.org/ubl/os-UBL-2.1/
|
||||
Release Date: 04 November 2013
|
||||
Module: UBL-xmldsig-core-schema-2.1.xsd
|
||||
Generated on: 2010-08-13 19:10(UTC)
|
||||
|
||||
This is a copy of http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
|
||||
modified only to remove these PUBLIC and SYSTEM identifiers from the DOCTYPE:
|
||||
|
||||
PUBLIC "-//W3C//DTD XMLSchema 200102//EN"
|
||||
"http://www.w3.org/2001/XMLSchema.dtd"
|
||||
-->
|
||||
<!DOCTYPE schema
|
||||
[
|
||||
<!ATTLIST schema
|
||||
xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
|
||||
<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
|
||||
<!ENTITY % p ''>
|
||||
<!ENTITY % s ''>
|
||||
]>
|
||||
|
||||
<!-- Schema for XML Signatures
|
||||
http://www.w3.org/2000/09/xmldsig#
|
||||
$Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
|
||||
|
||||
Copyright 2001 The Internet Society and W3C (Massachusetts Institute
|
||||
of Technology, Institut National de Recherche en Informatique et en
|
||||
Automatique, Keio University). All Rights Reserved.
|
||||
http://www.w3.org/Consortium/Legal/
|
||||
|
||||
This document is governed by the W3C Software License [1] as described
|
||||
in the FAQ [2].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
|
||||
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
|
||||
-->
|
||||
|
||||
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
||||
targetNamespace="http://www.w3.org/2000/09/xmldsig#"
|
||||
version="0.1" elementFormDefault="qualified">
|
||||
|
||||
<!-- Basic Types Defined for Signatures -->
|
||||
|
||||
<simpleType name="CryptoBinary">
|
||||
<restriction base="base64Binary">
|
||||
</restriction>
|
||||
</simpleType>
|
||||
|
||||
<!-- Start Signature -->
|
||||
|
||||
<element name="Signature" type="ds:SignatureType"/>
|
||||
<complexType name="SignatureType">
|
||||
<sequence>
|
||||
<element ref="ds:SignedInfo"/>
|
||||
<element ref="ds:SignatureValue"/>
|
||||
<element ref="ds:KeyInfo" minOccurs="0"/>
|
||||
<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<element name="SignatureValue" type="ds:SignatureValueType"/>
|
||||
<complexType name="SignatureValueType">
|
||||
<simpleContent>
|
||||
<extension base="base64Binary">
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
</extension>
|
||||
</simpleContent>
|
||||
</complexType>
|
||||
|
||||
<!-- Start SignedInfo -->
|
||||
|
||||
<element name="SignedInfo" type="ds:SignedInfoType"/>
|
||||
<complexType name="SignedInfoType">
|
||||
<sequence>
|
||||
<element ref="ds:CanonicalizationMethod"/>
|
||||
<element ref="ds:SignatureMethod"/>
|
||||
<element ref="ds:Reference" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
|
||||
<complexType name="CanonicalizationMethodType" mixed="true">
|
||||
<sequence>
|
||||
<any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<!-- (0,unbounded) elements from (1,1) namespace -->
|
||||
</sequence>
|
||||
<attribute name="Algorithm" type="anyURI" use="required"/>
|
||||
</complexType>
|
||||
|
||||
<element name="SignatureMethod" type="ds:SignatureMethodType"/>
|
||||
<complexType name="SignatureMethodType" mixed="true">
|
||||
<sequence>
|
||||
<element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
|
||||
<any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<!-- (0,unbounded) elements from (1,1) external namespace -->
|
||||
</sequence>
|
||||
<attribute name="Algorithm" type="anyURI" use="required"/>
|
||||
</complexType>
|
||||
|
||||
<!-- Start Reference -->
|
||||
|
||||
<element name="Reference" type="ds:ReferenceType"/>
|
||||
<complexType name="ReferenceType">
|
||||
<sequence>
|
||||
<element ref="ds:Transforms" minOccurs="0"/>
|
||||
<element ref="ds:DigestMethod"/>
|
||||
<element ref="ds:DigestValue"/>
|
||||
</sequence>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
<attribute name="URI" type="anyURI" use="optional"/>
|
||||
<attribute name="Type" type="anyURI" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<element name="Transforms" type="ds:TransformsType"/>
|
||||
<complexType name="TransformsType">
|
||||
<sequence>
|
||||
<element ref="ds:Transform" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<element name="Transform" type="ds:TransformType"/>
|
||||
<complexType name="TransformType" mixed="true">
|
||||
<choice minOccurs="0" maxOccurs="unbounded">
|
||||
<any namespace="##other" processContents="lax"/>
|
||||
<!-- (1,1) elements from (0,unbounded) namespaces -->
|
||||
<element name="XPath" type="string"/>
|
||||
</choice>
|
||||
<attribute name="Algorithm" type="anyURI" use="required"/>
|
||||
</complexType>
|
||||
|
||||
<!-- End Reference -->
|
||||
|
||||
<element name="DigestMethod" type="ds:DigestMethodType"/>
|
||||
<complexType name="DigestMethodType" mixed="true">
|
||||
<sequence>
|
||||
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="Algorithm" type="anyURI" use="required"/>
|
||||
</complexType>
|
||||
|
||||
<element name="DigestValue" type="ds:DigestValueType"/>
|
||||
<simpleType name="DigestValueType">
|
||||
<restriction base="base64Binary"/>
|
||||
</simpleType>
|
||||
|
||||
<!-- End SignedInfo -->
|
||||
|
||||
<!-- Start KeyInfo -->
|
||||
|
||||
<element name="KeyInfo" type="ds:KeyInfoType"/>
|
||||
<complexType name="KeyInfoType" mixed="true">
|
||||
<choice maxOccurs="unbounded">
|
||||
<element ref="ds:KeyName"/>
|
||||
<element ref="ds:KeyValue"/>
|
||||
<element ref="ds:RetrievalMethod"/>
|
||||
<element ref="ds:X509Data"/>
|
||||
<element ref="ds:PGPData"/>
|
||||
<element ref="ds:SPKIData"/>
|
||||
<element ref="ds:MgmtData"/>
|
||||
<any processContents="lax" namespace="##other"/>
|
||||
<!-- (1,1) elements from (0,unbounded) namespaces -->
|
||||
</choice>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<element name="KeyName" type="string"/>
|
||||
<element name="MgmtData" type="string"/>
|
||||
|
||||
<element name="KeyValue" type="ds:KeyValueType"/>
|
||||
<complexType name="KeyValueType" mixed="true">
|
||||
<choice>
|
||||
<element ref="ds:DSAKeyValue"/>
|
||||
<element ref="ds:RSAKeyValue"/>
|
||||
<any namespace="##other" processContents="lax"/>
|
||||
</choice>
|
||||
</complexType>
|
||||
|
||||
<element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
|
||||
<complexType name="RetrievalMethodType">
|
||||
<sequence>
|
||||
<element ref="ds:Transforms" minOccurs="0"/>
|
||||
</sequence>
|
||||
<attribute name="URI" type="anyURI"/>
|
||||
<attribute name="Type" type="anyURI" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<!-- Start X509Data -->
|
||||
|
||||
<element name="X509Data" type="ds:X509DataType"/>
|
||||
<complexType name="X509DataType">
|
||||
<sequence maxOccurs="unbounded">
|
||||
<choice>
|
||||
<element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
|
||||
<element name="X509SKI" type="base64Binary"/>
|
||||
<element name="X509SubjectName" type="string"/>
|
||||
<element name="X509Certificate" type="base64Binary"/>
|
||||
<element name="X509CRL" type="base64Binary"/>
|
||||
<any namespace="##other" processContents="lax"/>
|
||||
</choice>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<complexType name="X509IssuerSerialType">
|
||||
<sequence>
|
||||
<element name="X509IssuerName" type="string"/>
|
||||
<element name="X509SerialNumber" type="integer"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<!-- End X509Data -->
|
||||
|
||||
<!-- Begin PGPData -->
|
||||
|
||||
<element name="PGPData" type="ds:PGPDataType"/>
|
||||
<complexType name="PGPDataType">
|
||||
<choice>
|
||||
<sequence>
|
||||
<element name="PGPKeyID" type="base64Binary"/>
|
||||
<element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
|
||||
<any namespace="##other" processContents="lax" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<sequence>
|
||||
<element name="PGPKeyPacket" type="base64Binary"/>
|
||||
<any namespace="##other" processContents="lax" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
</choice>
|
||||
</complexType>
|
||||
|
||||
<!-- End PGPData -->
|
||||
|
||||
<!-- Begin SPKIData -->
|
||||
|
||||
<element name="SPKIData" type="ds:SPKIDataType"/>
|
||||
<complexType name="SPKIDataType">
|
||||
<sequence maxOccurs="unbounded">
|
||||
<element name="SPKISexp" type="base64Binary"/>
|
||||
<any namespace="##other" processContents="lax" minOccurs="0"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<!-- End SPKIData -->
|
||||
|
||||
<!-- End KeyInfo -->
|
||||
|
||||
<!-- Start Object (Manifest, SignatureProperty) -->
|
||||
|
||||
<element name="Object" type="ds:ObjectType"/>
|
||||
<complexType name="ObjectType" mixed="true">
|
||||
<sequence minOccurs="0" maxOccurs="unbounded">
|
||||
<any namespace="##any" processContents="lax"/>
|
||||
</sequence>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
<attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
|
||||
<attribute name="Encoding" type="anyURI" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<element name="Manifest" type="ds:ManifestType"/>
|
||||
<complexType name="ManifestType">
|
||||
<sequence>
|
||||
<element ref="ds:Reference" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
|
||||
<complexType name="SignaturePropertiesType">
|
||||
<sequence>
|
||||
<element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
|
||||
</sequence>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<element name="SignatureProperty" type="ds:SignaturePropertyType"/>
|
||||
<complexType name="SignaturePropertyType" mixed="true">
|
||||
<choice maxOccurs="unbounded">
|
||||
<any namespace="##other" processContents="lax"/>
|
||||
<!-- (1,1) elements from (1,unbounded) namespaces -->
|
||||
</choice>
|
||||
<attribute name="Target" type="anyURI" use="required"/>
|
||||
<attribute name="Id" type="ID" use="optional"/>
|
||||
</complexType>
|
||||
|
||||
<!-- End Object (Manifest, SignatureProperty) -->
|
||||
|
||||
<!-- Start Algorithm Parameters -->
|
||||
|
||||
<simpleType name="HMACOutputLengthType">
|
||||
<restriction base="integer"/>
|
||||
</simpleType>
|
||||
|
||||
<!-- Start KeyValue Element-types -->
|
||||
|
||||
<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
|
||||
<complexType name="DSAKeyValueType">
|
||||
<sequence>
|
||||
<sequence minOccurs="0">
|
||||
<element name="P" type="ds:CryptoBinary"/>
|
||||
<element name="Q" type="ds:CryptoBinary"/>
|
||||
</sequence>
|
||||
<element name="G" type="ds:CryptoBinary" minOccurs="0"/>
|
||||
<element name="Y" type="ds:CryptoBinary"/>
|
||||
<element name="J" type="ds:CryptoBinary" minOccurs="0"/>
|
||||
<sequence minOccurs="0">
|
||||
<element name="Seed" type="ds:CryptoBinary"/>
|
||||
<element name="PgenCounter" type="ds:CryptoBinary"/>
|
||||
</sequence>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
|
||||
<complexType name="RSAKeyValueType">
|
||||
<sequence>
|
||||
<element name="Modulus" type="ds:CryptoBinary"/>
|
||||
<element name="Exponent" type="ds:CryptoBinary"/>
|
||||
</sequence>
|
||||
</complexType>
|
||||
|
||||
<!-- End KeyValue Element-types -->
|
||||
|
||||
<!-- End Signature -->
|
||||
|
||||
</schema>
|
||||
|
|
@ -0,0 +1,628 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Validate UBL Invoice and UBL Credit Note(XML file) for compliance with the national rules RO_CIUS
|
||||
Schematron version 1.0.8 - Last update: 2022-10-18:
|
||||
- modify Syntax of Specification identifier element (BT-24)(RO-MAJOR-MINOR-PATCH-VERSION value = 1.0.1);
|
||||
- modify allowed maximum number of characters for BT-1, BT-12, BT-13, BT-14, BT-15, BT-16, BT-17, BT-18, BT-25 and BT-122(200)
|
||||
- replace special and romanian characters in error messages;
|
||||
- correction error messages for BR-RO-100, BR-RO-160, BR-RO-200;
|
||||
- apply BR-R0-100 to BT-52(id=BR-RO-101) and BR-RO-110 to BT-54(id=BR-RO-111);
|
||||
- eliminate rules BR-RO-L030 and BR-RO-A999
|
||||
RO_CIUS version 1.0.1 - Last update: 2022-10-18
|
||||
-->
|
||||
<schema xmlns="http://purl.oclc.org/dsdl/schematron"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
queryBinding="xslt"
|
||||
defaultPhase="roefactura-model">
|
||||
<title>Schematron Version 1.0.8 - CIUS-RO version 1.0.1 compatible - UBL - Invoice</title>
|
||||
<ns prefix="ext" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" />
|
||||
<ns prefix="cbc" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" />
|
||||
<ns prefix="cac" uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" />
|
||||
<ns prefix="qdt" uri="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2" />
|
||||
<ns prefix="udt" uri="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2" />
|
||||
<ns prefix="cn" uri="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" />
|
||||
<ns prefix="ubl" uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" />
|
||||
<ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema" />
|
||||
|
||||
<phase id="roefactura-model">
|
||||
<active pattern="ubl-pattern" />
|
||||
</phase>
|
||||
<!-- Validate UBL Invoice and UBL Credit Notes according to the national rules RO_CIUS -->
|
||||
<pattern id="ubl-pattern">
|
||||
<!-- Declaring global variables (in XSLT speak) -->
|
||||
<!-- Syntax of Specification identifier element (BT-24) according to the RO_CIUS -->
|
||||
<let name="RO-MAJOR-MINOR-PATCH-VERSION" value="'1.0.1'"/>
|
||||
<let name="RO-CIUS-ID" value="concat('urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:', $RO-MAJOR-MINOR-PATCH-VERSION)"/>
|
||||
<!-- An email address should contain exactly one @ character, which should not be flanked by a space, a period, but at least two characters on either side. A period should not be at the beginning or at the end -->
|
||||
<let name="RO-EMAIL-REGEX" value="'^[0-9a-zA-Z]([0-9a-zA-Z\.]*)[^\.\s@]@[^\.\s@]([0-9a-zA-Z\.]*)[0-9a-zA-Z]$'" />
|
||||
<!-- A telephone number should contain at least three digits. -->
|
||||
<let name="RO-TELEPHONE-REGEX" value="'.*([0-9].*){3,}.*'" />
|
||||
<!-- ISO 3166-2:RO and SECTOR Codelists (applicable for countryCode = "RO") -->
|
||||
<let name="ISO-3166-RO-CODES" value="('RO-AB','RO-AG','RO-AR','RO-B','RO-BC','RO-BH','RO-BN','RO-BR','RO-BT','RO-BV','RO-BZ','RO-CJ','RO-CL','RO-CS','RO-CT', 'RO-CV', 'RO-DB', 'RO-DJ', 'RO-GJ', 'RO-GL', 'RO-GR', 'RO-HD', 'RO-HR' , 'RO-IF', 'RO-IL', 'RO-IS', 'RO-MH', 'RO-MM', 'RO-MS', 'RO-NT', 'RO-OT', 'RO-PH', 'RO-SB', 'RO-SJ', 'RO-SM', 'RO-SV', 'RO-TL', 'RO-TM', 'RO-TR', 'RO-VL', 'RO-VN', 'RO-VS')"/>
|
||||
<let name="SECTOR-RO-CODES" value="('SECTOR1', 'SECTOR2', 'SECTOR3', 'SECTOR4', 'SECTOR5', 'SECTOR6')"/>
|
||||
<!-- invoice type code constrains(BT-3) -->
|
||||
<rule flag="fatal" context="cbc:InvoiceTypeCode | cbc:CreditNoteTypeCode">
|
||||
<assert test="(self::cbc:InvoiceTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 380 384 389 751 ', concat(' ', normalize-space(.), ' '))))) or (self::cbc:CreditNoteTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 381 ', concat(' ', normalize-space(.), ' ')))))"
|
||||
flag="fatal"
|
||||
id="BR-RO-020"
|
||||
>[BR-RO-020]-Codul tipului facturii (BT-3) trebuie sa fie unul dintre urmatoarele coduri din lista de coduri UNTDID 1001: 380 (Factura), 389 (Autofactura), 384 (Factura corectata), 381 (Nota de creditare), 751 (Factura — informatii în scopuri contabile).
|
||||
#The invoice type code (BT-3) must be one of the following codes in the UNTDID 1001 code list: 380 (Invoice), 389 (Self-invoice), 384 (Corrected invoice), 381 (Credit note), 751 (Invoice - information for accounting purposes).</assert>
|
||||
</rule>
|
||||
<!-- specification identifier(BT-24) constrains -->
|
||||
<rule context="/ubl:Invoice | /cn:CreditNote">
|
||||
<assert test="cbc:CustomizationID = $RO-CIUS-ID"
|
||||
flag="fatal"
|
||||
id="BR-RO-001"
|
||||
>[BR-RO-001]-Identificatorul specificatie (BT-24) trebuie sa corespunda sintactic cu valoarea precizata in Specificatii tehnice și de utilizare a elementelor de baza ale facturii electronice - RO_CIUS - și a regulilor operationale specifice aplicabile la nivel national.
|
||||
#The specification identifier (BT-24) must syntactically correspond to the value specified in the Technical and Usage Specifications of the basic elements of the electronic invoice - RO_CIUS - and the specific operational rules applicable at national level(<value-of select="$RO-CIUS-ID"/>).</assert>
|
||||
<!-- occurrences constrains -->
|
||||
<assert test="count(cbc:Note) <= 20"
|
||||
flag="fatal"
|
||||
id="BR-RO-A020"
|
||||
>[BR-RO-A020]-O factura trebuie sa contina maximum 20 de aparitii ale grupului Comentariu in factura (BG-1).
|
||||
#The allowed maximum number of occurences of Invoice note (BG-1) is 20.</assert>
|
||||
<!-- string-length constrains -->
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone)) <=20"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0201"
|
||||
>[BR-RO-L020]-Numarul maxim permis de caractere pentru Codul postal al Vanzatorului (BT-38) este 20.
|
||||
#The allowed maximum number of characters for the Seller post code (BT-38) is 20.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone)) <=20"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0202"
|
||||
>[BR-RO-L020]-Numarul maxim permis de caractere pentru Codul postal al Cumparatorului (BT-53) este 20.
|
||||
#The allowed maximum number of characters for the Buyer post code (BT-53) is 20.</assert>
|
||||
<assert test="string-length(normalize-space(cac:TaxRepresentativeParty/cac:PostalAddress/cbc:PostalZone)) <= 20"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0203"
|
||||
>[BR-RO-L020]-Numarul maxim permis de caractere pentru Codul postal al reprezentantului fiscal (BT-67) este 20.
|
||||
#The allowed maximum number of characters for the Tax representative post code (BT-67) is 20.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:PostalZone)) <= 20"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0204"
|
||||
>[BR-RO-L020]-Numarul maxim permis de caractere pentru Codul postal de livrare (BT-78) este 20.
|
||||
#The allowed maximum number of characters for the Deliver to post code (BT-78) is 20.</assert>
|
||||
|
||||
<assert test="string-length(normalize-space(cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L155"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numarul facturii (BT-1) este 200.
|
||||
#The allowed maximum number of characters for the Invoice number (BT-1) is 200.</assert>
|
||||
|
||||
<assert test="string-length(normalize-space(cac:ContractDocumentReference/cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0302"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Referinta contractului (BT-12) este 200.
|
||||
#The allowed maximum number of characters for the Contract reference(BT-12) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:OrderReference/cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0303"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Referinta comenzii (BT-13) este 200.
|
||||
#The allowed maximum number of characters for the Purchase order reference(BT-13) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:OrderReference/cbc:SalesOrderID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0304"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Referinta dispozitiei de vanzare (BT-14) este 200.
|
||||
#The allowed maximum number of characters for the Sales order reference (BT-14) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:ReceiptDocumentReference/cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0305"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Referinta avizului de receptie (BT-15) este 200.
|
||||
#The allowed maximum number of characters for the Receiving advice reference (BT-15) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:DespatchDocumentReference/cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0306"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Referinta avizului de expeditie (BT-16) este 200.
|
||||
#The allowed maximum number of characters for the Despatch advice reference (BT-16) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:OriginatorDocumentReference/cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0307"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Referinta cererii de oferta sau a lotului (BT-17) este 200.
|
||||
#The allowed maximum number of characters for the Tender or lot reference (BT-17) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CityName)) <= 50"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0501"
|
||||
>[BR-RO-L050]-Numarul maxim permis de caractere pentru Localitatea Vanzatorului (BT-37) este 50.
|
||||
#The allowed maximum number of characters for the Seller city (BT-37) is 50.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName)) <= 50"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0502"
|
||||
>[BR-RO-L050]-Numarul maxim permis de caractere pentru Localitatea Cumparatorului (BT-52) este 50.
|
||||
#The allowed maximum number of characters for the Buyer city (BT-52) is 50.</assert>
|
||||
<assert test="string-length(normalize-space(cac:TaxRepresentativeParty/cac:PostalAddress/cbc:CityName)) <= 50"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0503"
|
||||
>[BR-RO-L050]-Numarul maxim permis de caractere pentru Localitatea reprezentantului fiscal (BT-66) este 50.
|
||||
#The allowed maximum number of characters for the Tax representative city (BT-66) is 50.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:CityName)) <= 50"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0504"
|
||||
>[BR-RO-L050]-Numarul maxim permis de caractere pentru Localitatea de livrare (BT-77) este 50.
|
||||
#The allowed maximum number of characters for the Deliver to city (BT-77) is 50.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:AccountingCost)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1001"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Referinta contabila a Cumparatorului (BT-19) este 100.
|
||||
#The allowed maximum number of characters for the Buyer accounting reference (BT-19) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:AdditionalStreetName)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1002"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa Vanzatorului - Linia 2 (BT-36) este 100.
|
||||
#The allowed maximum number of characters for the Seller address line 2 (BT-36) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:AddressLine/cbc:Line)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1003"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa Vanzatorului - Linia 3 (BT-162) este 100.
|
||||
#The allowed maximum number of characters for the Seller address line 3 (BT-162) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:Contact/cbc:Name)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1004"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Punctul de contact al Vanzatorului (BT-41) este 100.
|
||||
#The allowed maximum number of characters for the Seller contact point (BT-41) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:Contact/cbc:Telephone)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1005"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Numarul de telefon al contactului Vanzatorului (BT-42) este 100.
|
||||
#The allowed maximum number of characters for the Seller contact telephone number (BT-42) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:Contact/cbc:ElectronicMail)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1006"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa de email a contactului Vanzatorului (BT-43) este 100.
|
||||
#The allowed maximum number of characters for the Seller contact email address (BT-43) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:AdditionalStreetName)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1007"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa Cumparatorului - Linia 2 (BT-51) este 100.
|
||||
#The allowed maximum number of characters for the Buyer address line 2 (BT-51) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:AddressLine/cbc:Line)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1008"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa Cumparatorului - Linia 3 (BT-163) este 100.
|
||||
#The allowed maximum number of characters for the Buyer address line 3 (BT-163) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Name)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1009"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Punctul de contact al Cumparatorului (BT-56) este 100.
|
||||
#The allowed maximum number of characters for the Buyer contact point (BT-56) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Telephone)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1010"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Numarul de telefon al contactului Cumparatorului (BT-57) este 100.
|
||||
#The allowed maximum number of characters for the Buyer contact telephone number (BT-57) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1011"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa de email a contactului Cumparatorului (BT-58) este 100.
|
||||
#The allowed maximum number of characters for the Buyer contact email address (BT-58) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:TaxRepresentativeParty/cac:PostalAddress/cbc:AdditionalStreetName)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1012"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa reprezentantului fiscal - Linia 2 (BT-65) este 100.
|
||||
#The allowed maximum number of characters for the Tax representative address line 2 (BT-65) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:TaxRepresentativeParty/cac:PostalAddress/cac:AddressLine/cbc:Line)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1013"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa reprezentantului fiscal - Linia 3 (BT-164) este 100.
|
||||
#The allowed maximum number of characters for the Tax representative address line 3 (BT-164) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:AdditionalStreetName)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1014"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa de livrare - Linia 2 (BT-76) este 100.
|
||||
#The allowed maximum number of characters for the Deliver to address line 2 (BT-76) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Delivery/cac:DeliveryLocation/cac:Address/cac:AddressLine/cbc:Line)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1015"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Adresa de livrare - Linia 3 (BT-165) este 100.
|
||||
#The allowed maximum number of characters for the Deliver to address line 3 (BT-165) is 100.</assert>
|
||||
|
||||
<assert test="string-length(normalize-space(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:TaxExemptionReason)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1019"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Motivul scutirii de TVA (BT-120) este 100.
|
||||
#The allowed maximum number of characters for the VAT exemption reason text (BT-120) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName)) <= 150"
|
||||
flag="fatal"
|
||||
id="BR-RO-L151"
|
||||
>[BR-RO-L150]-Numarul maxim permis de caractere pentru Adresa Vanzatorului - Linia 1 (BT-35) este 150.
|
||||
#The allowed maximum number of characters for the Seller address line 1 (BT-35) is 150.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName)) <= 150"
|
||||
flag="fatal"
|
||||
id="BR-RO-L152"
|
||||
>[BR-RO-L150]-Numarul maxim permis de caractere pentru Adresa Cumparatorului - Linia 1 (BT-50) este 150.
|
||||
#The allowed maximum number of characters for the Buyer address line 1 (BT-50) is 150.</assert>
|
||||
<assert test="string-length(normalize-space(cac:TaxRepresentativeParty/cac:PostalAddress/cbc:StreetName)) <= 150"
|
||||
flag="fatal"
|
||||
id="BR-RO-L153"
|
||||
>[BR-RO-L150]-Numarul maxim permis de caractere pentru Adresa reprezentantului fiscal - Linia 1 (BT-64) este 150.
|
||||
#The allowed maximum number of characters for the Tax representative address line 1 (BT-64) is 150.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:StreetName)) <= 150"
|
||||
flag="fatal"
|
||||
id="BR-RO-L154"
|
||||
>[BR-RO-L150]-Numarul maxim permis de caractere pentru Adresa de livrare - Linia(BT-75) 1 este 150.
|
||||
#The allowed maximum number of characters for the Deliver to address line 1(BT-75) is 150.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L201"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele Vanzatorului (BT-27) este 200.
|
||||
#The allowed maximum number of characters for the Seller name (BT-27) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyName/cbc:Name)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L202"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Denumirea comerciala a Vanzatorului (BT-28), este 200.
|
||||
#The allowed maximum number of characters for the Seller trading name (BT-28) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L203"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele Cumparatorului (BT-44), este 200.
|
||||
#The allowed maximum number of characters for the Buyer name (BT-44) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PartyName/cbc:Name)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L204"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Denumirea comerciala a Cumparatorului (BT-45), este 200.
|
||||
#The allowed maximum number of characters for the Buyer trading name (BT-45) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:PayeeParty/cac:PartyName/cbc:Name)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L205"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele Beneficiarului (BT-59), este 200.
|
||||
#The allowed maximum number of characters for the Payee name (BT-59) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:TaxRepresentativeParty/cac:PartyName/cbc:Name)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L206"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele reprezentantului fiscal al Vanzatorului (BT-62), este 200.
|
||||
#The allowed maximum number of characters for the Seller tax representative name (BT-62) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Delivery/cac:DeliveryParty/cac:PartyName/cbc:Name)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L207"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele partii catre care se face livrarea (BT-70), este 200.
|
||||
#The allowed maximum number of characters for the Deliver to party name (BT-70) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:PaymentTerms/cbc:Note)) <= 300"
|
||||
flag="fatal"
|
||||
id="BR-RO-L301"
|
||||
>[BR-RO-L300]-Numarul maxim permis de caractere pentru Termeni de plata (BT-20) este 300.
|
||||
#The allowed maximum number of characters for the Payment terms (BT-20) is 300.</assert>
|
||||
<assert test="string-length(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyLegalForm)) <= 1000"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1000"
|
||||
>[BR-RO-L1000]-Numarul maxim permis de caractere pentru Informatii juridice suplimentare despre Vanzator (BT-33)) este 1000.
|
||||
#The allowed maximum number of characters for the Seller additional legal (BT-33) is 1000.</assert>
|
||||
<!-- business constrains -->
|
||||
<assert test="matches(normalize-space(cbc:ID), '([0-9])')"
|
||||
flag="fatal"
|
||||
id="BR-RO-010"
|
||||
>[BR-RO-010]-Numarul facturii (BT-1) trebuie sa includa cel putin un caracter numeric (0—9).
|
||||
#Invoice number (BT-1) must include at least one numeric character (0-9).</assert>
|
||||
<assert test="(normalize-space(cbc:TaxCurrencyCode) = 'RON' and normalize-space(cbc:DocumentCurrencyCode) != 'RON') or (normalize-space(cbc:TaxCurrencyCode) = 'RON' and normalize-space(cbc:DocumentCurrencyCode) = 'RON') or (normalize-space(cbc:TaxCurrencyCode) != 'RON' and normalize-space(cbc:DocumentCurrencyCode) = 'RON') or (not(exists (cbc:TaxCurrencyCode)) and normalize-space(cbc:DocumentCurrencyCode) = 'RON')"
|
||||
flag="fatal"
|
||||
id="BR-RO-030"
|
||||
>[BR-RO-030]-Daca Codul monedei facturii (BT-5) este altul decat RON, atunci Codul monedei de contabilizare a TVA (BT-6) trebuie sa fie RON.
|
||||
#If the Invoice currency code (BT-5) is other than RON, then the VAT accounting currency code(BT-6) must be RON.</assert>
|
||||
<assert 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:PartyTaxScheme/cbc:CompanyID, cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])"
|
||||
flag="fatal"
|
||||
id="BR-RO-065"
|
||||
>[BR-RO-065]-Identificatorul de înregistrare fiscala a Vanzatorului (BT-32) si/sau Identificatorul de TVA al Vanzatorului (BT-31) si/sau Identificatorul de TVA al reprezentantului fiscal al Vanzatorului (BT-63) trebuie sa fie înscris.
|
||||
#The Seller tax registration identifier (BT-32) and/or the Seller VAT identifier (BT-31) and/or the Seller tax representative VAT identifier (BT-63) shall be present.</assert>
|
||||
<assert test="cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-081"
|
||||
>[BR-RO-080]-Adresa Vanzatorului - Linia 1 (BT-35) trebuie furnizata.
|
||||
#Seller address line 1(BT-35) must be provided.</assert>
|
||||
<assert test="cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-082"
|
||||
>[BR-RO-080]-Adresa Cumparatorului - Linia 1 (BT-50) trebuie furnizata.
|
||||
#Buyer address line 1(BT-50) must be provided.</assert>
|
||||
<assert test="cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CityName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-091"
|
||||
>[BR-RO-090]-Localitatea Vanzatorului (BT-37) trebuie furnizata.
|
||||
#Seller city(BT-37) must be provided.</assert>
|
||||
<assert test="cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-092"
|
||||
>[BR-RO-090]-Localitatea Cumparatorului (BT-52) trebuie furnizata.
|
||||
#Buyer city(BT-37) must be provided.</assert>
|
||||
<report test="normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) = 'RO' and normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) = 'RO-B' and not(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CityName) = $SECTOR-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-100"
|
||||
>[BR-RO-100]-Daca Codul tarii Vanzatorului (BT-40) este RO si Subdiviziunea tarii Vanzatorului (BT-39) este RO-B (corespunzator Municipiului Bucuresti), atunci Localitatea Vanzatorului (BT-37) trebuie sa fie codificata folosind lista de coduri SECTOR-RO.
|
||||
#If the Seller's country Code (BT-40) is RO and the Seller's country subdivision (BT-39) is RO-B (corresponding to Bucharest Municipality), then the Seller city (BT-37) must be coded using the code list SECTOR-RO(SECTOR1, SECTOR2, SECTOR3, SECTOR4, SECTOR5, SECTOR6).</report>
|
||||
<report test="normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) = 'RO' and not(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) = $ISO-3166-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-110"
|
||||
>[BR-RO-110]-Daca Codul tarii Vanzatorului (BT-40) este RO, atunci Subdiviziunea tarii Vanzatorului (BT-39) trebuie sa fie codificata folosind lista de coduri ISO 3166-2:RO (ex. "RO-B" pentru Municipiul Bucuresti, "RO-AB" pentru judetul Alba...).
|
||||
#If the Seller's country Code (BT-40) is RO, then the Seller's country subdivision (BT-39) must be coded using the ISO 3166-2: RO code list (ex. "RO-B" for Bucharest, "RO-AB" for Alba County...).</report>
|
||||
<report test="normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) = 'RO' and normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) = 'RO-B' and not(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) = $SECTOR-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-101"
|
||||
>[BR-RO-100]-Daca Codul tarii Cumparatorului (BT-55) este RO si Subdiviziunea tarii Cumparatorului (BT-54) este RO-B (corespunzator Municipiului Bucuresti), atunci Localitatea Cumparatorului (BT-52) trebuie sa fie codificata folosind lista de coduri SECTOR-RO.
|
||||
#If the Buyer's country Code (BT-55) is RO and the Buyer's country subdivision (BT-54) is RO-B (corresponding to Bucharest Municipality), then the Buyer city (BT-52) must be coded using the code list SECTOR-RO(SECTOR1, SECTOR2, SECTOR3, SECTOR4, SECTOR5, SECTOR6).</report>
|
||||
<report test="normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) = 'RO' and not(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) = $ISO-3166-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-111"
|
||||
>[BR-RO-110]-Daca Codul tarii Cumparatorului (BT-55) este RO, atunci Subdiviziunea tarii Cumparatorului (BT-54) trebuie sa fie codificata folosind lista de coduri ISO 3166-2:RO (ex. "RO-B" pentru Municipiul Bucuresti, "RO-AB" pentru judetul Alba...).
|
||||
#If the Buyer's country Code (BT-55) is RO, then the Buyer's country subdivision (BT-54) must be coded using the ISO 3166-2: RO code list (ex. "RO-B" for Bucharest, "RO-AB" for Alba County...).</report>
|
||||
<assert 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:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID, cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID[boolean(normalize-space(.))])"
|
||||
flag="fatal"
|
||||
id="BR-RO-120"
|
||||
>[BR-RO-120]-Identificatorul de înregistrare legala a Cumparatorului (BT-47) si/sau Identificatorul de TVA al Cumparatorului (BT-48) trebuie sa fie înscris.
|
||||
#The Buyer legal registration identifier (BT-47) and/or the Buyer VAT identifier (BT-48) shall be present.</assert>
|
||||
</rule>
|
||||
<rule context="/ubl:Invoice/cac:TaxRepresentativeParty/cac:PostalAddress | /ubl:CreditNote/cac:TaxRepresentativeParty/cac:PostalAddress">
|
||||
<assert test="cbc:StreetName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-140"
|
||||
>[BR-RO-140"]-Adresa poștala a reprezentantului fiscal al Vanzatorului (BG-12) trebuie sa contina Linia 1 (BT-64), daca Vanzatorul (BG-4) are un reprezentant fiscal al Vanzatorului (BG-11).
|
||||
#Tax representative address line 1 BT-64 ) must be provided, if the Seller (BG-4) has a Seller tax representative party (BG-11)</assert>
|
||||
<assert test="cbc:CityName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-150"
|
||||
>[BR-RO-150]-Adresa poștala a reprezentantului fiscal al Vanzatorului (BG-12) trebuie sa contina Localitatea reprezentantului fiscal (BT-66), daca Vanzatorul (BG-4) are un reprezentant fiscal al Vanzatorului (BG-11).
|
||||
#Tax representative city (BT-66 ) must be provided, if the Seller (BG-4) has a Seller tax representative party (BG-11),</assert>
|
||||
<report test="normalize-space(cac:Country/cbc:IdentificationCode) = 'RO' and normalize-space(cbc:CountrySubentity) = 'RO-B' and not(normalize-space(cbc:CityName) = $SECTOR-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-160"
|
||||
>[BR-RO-160]-Daca Codul tarii Reprezentantului fiscal al Vanzatorului (BT-69) este RO si Subdiviziunea tarii Reprezentantului fiscal al Vanzatorului (BT-68) este RO-B (corespunzator Municipiului Bucuresti), atunci Localitatea reprezentantului fiscal al Vanzatorului (BT-66) trebuie sa fie codificata folosind lista de coduri SECTOR-RO.
|
||||
#If the Tax representative country code (BT-69) is RO and the Tax representative country subdivision (BT-68) is RO-B (corresponding to Bucharest Municipality), then the Tax representative city(BT-66) must be coded using the code list SECTOR-RO(SECTOR1, SECTOR2, SECTOR3, SECTOR4, SECTOR5, SECTOR6).</report>
|
||||
<report test="normalize-space(cac:Country/cbc:IdentificationCode) = 'RO' and not(normalize-space(cbc:CountrySubentity) = $ISO-3166-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-170"
|
||||
>[BR-RO-170]-Daca Codul tarii Reprezentantului fiscal al Vanzatorului (BT-69) este RO, atunci Subdiviziunea tarii Reprezentantului fiscal al Vanzatorului (BT-68) trebuie sa fie codificata folosind lista de coduri ISO 3166-2:RO (ex. RO-B pentru Municipiul Bucuresti, RO-AB pentru judetul Alba...).
|
||||
#If the Seller's tax representative country code (BT-69) is RO, then the Seller's tax representative country subdivision (BT-68) must be coded using the ISO 3166-2: RO code list (ex. RO-B for Bucharest, RO-AB for Alba County...).</report>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans">
|
||||
<assert test="string-length(normalize-space(cac:PayeeFinancialAccount/cbc:Name)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L208"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele contului de plata (BT-85), este 200.
|
||||
#The allowed maximum number of characters for the Payment account name (BT-85) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:CardAccount/cbc:HolderName)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L209"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele detinatorului cardului de plata (BT-88), este 200.
|
||||
#The allowed maximum number of characters for the Payment card holder name(BT-88) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:PaymentMeansCode/@name)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1016"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Explicatii privind instrumentul de plata (BT-82) este 100.
|
||||
#The allowed maximum number of characters for the Payment means text (BT-82) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:PaymentID)) <= 140"
|
||||
flag="fatal"
|
||||
id="BR-RO-L140"
|
||||
>[BR-RO-L140]-Numarul maxim permis de caractere pentru Aviz de plata (BT-83) este 140.
|
||||
#The allowed maximum number of characters for the Remittance information (BT-83) is 140.</assert>
|
||||
</rule>
|
||||
<rule context="/ubl:Invoice/cac:Delivery/cac:DeliveryLocation/cac:Address | /ubl:CreditNote/cac:Delivery/cac:DeliveryLocation/cac:Address">
|
||||
<assert test="cbc:StreetName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-180"
|
||||
>[BR-RO-180"-Daca Adresa de livrare (BG-15) exista, trebuie furnizata Adresa de livrare — linia 1 (BT-75).
|
||||
#If the Delivery to (BG-15) exists, the Deliver to address line 1 (BT-75) must exists.</assert>
|
||||
<assert test="cbc:CityName[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-201"
|
||||
>[BR-RO-200]-Daca Adresa de livrare (BG-15) exista, trebuie furnizata Localitatea de livrare (BT-77).
|
||||
#If the Delivery to (BG-15) exists, the Deliver to city (BT-77) must exists.</assert>
|
||||
<report test="normalize-space(cac:Country/cbc:IdentificationCode) = 'RO' and normalize-space(cbc:CountrySubentity) = 'RO-B' and not(normalize-space(cbc:CityName) = $SECTOR-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-202"
|
||||
>[BR-RO-200]-Daca Codul tarii de livrare (BT-80) este RO si Subdiviziunea tarii de livrare (BT-79) este "RO-B" (corespunzator Municipiului Bucuresti), atunci Localitatea de livrare (BT-77) trebuie sa fie codificata folosind lista de coduri SECTOR-RO.
|
||||
#If the Delivery to country code (BT-80) is RO and the Delivery to country subdivision (BT-79) is "RO-B" (corresponding to Bucharest Municipality), then the Delivery to city(BT-77) must be coded using the code list SECTOR-RO(SECTOR1, SECTOR2, SECTOR3, SECTOR4, SECTOR5, SECTOR6).</report>
|
||||
<assert test="cbc:CountrySubentity[boolean(normalize-space(.))]"
|
||||
flag="fatal"
|
||||
id="BR-RO-211"
|
||||
>[BR-RO-210"]-Daca Adresa de livrare (BG-15) exista, trebuie furnizata Subdiviziunea tarii de livrare (BT-79).
|
||||
#If the Delivery to (BG-15) exists, the Deliver to country subdivision (BT-79) must exists.</assert>
|
||||
<report test="normalize-space(cac:Country/cbc:IdentificationCode) = 'RO' and not(normalize-space(cbc:CountrySubentity) = $ISO-3166-RO-CODES)"
|
||||
flag="fatal"
|
||||
id="BR-RO-212"
|
||||
>[BR-RO-210]-Daca Codul tarii de livrare (BT-80) este "RO", atunci Subdiviziunea tarii de livrare (BT-79) trebuie sa fie codificata folosind lista de coduri ISO 3166-2:RO (ex. "RO-B" pentru Municipiul Bucuresti, "RO-AB" pentru judetul Alba...).
|
||||
#If Delivery country code (BT-80) is "RO", then Delivery country subdivision (BT-79) must be coded using the ISO 3166-2: RO code list (ex. "RO-B" for Bucharest, "RO-AB" for Alba County...).</report>
|
||||
</rule>
|
||||
<rule flag="fatal" context="cac:InvoicePeriod/cbc:DescriptionCode">
|
||||
<assert test="((not(contains(normalize-space(.), ' ')) and contains(' 3 35 432 ', concat(' ', normalize-space(.), ' '))))"
|
||||
flag="fatal"
|
||||
id="BR-RO-040"
|
||||
>[BR-RO-040]-Codul datei de exigibilitate a taxei pe valoarea adaugata (BT-8) trebuie sa fie unul dintre urmatoarele coduri din lista de coduri UNTDID 2005: 3 (Data emiterii facturii), 35 (Data reala a livrarii), 432 (Suma platita în acea zi).
|
||||
#Value added tax point date code MUST be coded using a restriction of UNTDID 2005 (only 3, 35 and 432).</assert>
|
||||
</rule>
|
||||
<!-- line-level constrains -->
|
||||
<rule context="cac:InvoiceLine | cac:CreditNoteLine">
|
||||
<assert test="string-length(normalize-space(cac:Item/cbc:Name)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1024"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Numele articolului (BT-153) este 100.
|
||||
#The allowed maximum number of characters for the Item name (BT-153) is 100.</assert>
|
||||
|
||||
<assert test="string-length(normalize-space(cbc:AccountingCost)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1021"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Referinta contabila a Cumparatorului din linia facturii (BT-133) este 100.
|
||||
#The allowed maximum number of characters for the Invoice line Buyer accounting reference (BT-133) is 100.</assert>
|
||||
|
||||
<assert test="string-length(normalize-space(cac:Item/cbc:Description)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L212"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Descrierea articolului (BT-154) este 200.
|
||||
#The allowed maximum number of characters for the Item description (BT-154) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:Note)) <= 300"
|
||||
flag="fatal"
|
||||
id="BR-RO-L303"
|
||||
>[BR-RO-L300]-Numarul maxim permis de caractere pentru Nota liniei facturii (BT-127) este 300.
|
||||
#The allowed maximum number of characters for the Invoice line note (BT-127) is 300.</assert>
|
||||
</rule>
|
||||
<rule context="//cac:Item/cac:AdditionalItemProperty">
|
||||
<assert test="count(.) <= 50"
|
||||
flag="fatal"
|
||||
id="BR-RO-A052"
|
||||
>[BR-RO-A050]-O factura trebuie sa contina maximum 50 de aparitii ale grupului Atributele articolului (BG-32).
|
||||
#The allowed maximum number of occurences of Item attributes (BG-32) is 50.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:Name)) <= 50"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0505"
|
||||
>[BR-RO-L050]-Numarul maxim permis de caractere pentru Numele atributului articolului (BT-160) este 50.
|
||||
#The allowed maximum number of characters for the Item attribute name (BT-160) is 50.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:Value)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1025"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Valoarea atributului articolului (BT-161) este 100.
|
||||
#The allowed maximum number of characters for the Item attribute value (BT-161) is 100.</assert>
|
||||
</rule>
|
||||
<!-- amount number of decimals constrains -->
|
||||
<rule context="/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | /ubl:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = false()]">
|
||||
<assert id="BR-DEC-RO-01" flag="fatal" test="string-length(substring-after(cbc:Amount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea deducerilor la nivelul documentului (BT-92) este 2.
|
||||
#The allowed maximum number of decimals for the Document level allowance amount(BT-92) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-02" flag="fatal" test="string-length(substring-after(cbc:BaseAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea de baza a deducerii la nivelul documentului (BT-93) este 2.
|
||||
#The allowed maximum number of decimals for the Document level allowance base amount(BT-93) is 2.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:AllowanceChargeReasonCode)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1017"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Motivul deducerii la nivelul documentului (BT-97) este 100.
|
||||
#The allowed maximum number of characters for the Document level allowance reason (BT-97) is 100.</assert>
|
||||
</rule>
|
||||
<rule context="/ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator = true()] | /ubl:CreditNote/cac:AllowanceCharge[cbc:ChargeIndicator = true()]">
|
||||
<assert id="BR-DEC-RO-05" flag="fatal" test="string-length(substring-after(cbc:Amount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea taxelor suplimentare la nivelul documentului (BT-99) este 2.
|
||||
#The allowed maximum number of decimals for the Document level charge amount (BT-99) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-06" flag="fatal" test="string-length(substring-after(cbc:BaseAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea de baza a taxelor suplimentare la nivelul documentului (BT-100) este 2.
|
||||
#The allowed maximum number of decimals for the Document level charge base amount (BT-100) is 2.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:AllowanceChargeReasonCode)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1018"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Motivul taxei suplimentare la nivelul documentului (BT-104) este 100.
|
||||
#The allowed maximum number of characters for the Document level charge reason (BT-104) is 100.</assert>
|
||||
</rule>
|
||||
<rule context="cac:LegalMonetaryTotal">
|
||||
<assert id="BR-DEC-RO-09" flag="fatal" test="string-length(substring-after(cbc:LineExtensionAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Suma valorilor nete ale liniilor facturii (BT-106) este 2.
|
||||
#The allowed maximum number of decimals for the Sum of Invoice line net amount (BT-106) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-10" flag="fatal" test="string-length(substring-after(cbc:AllowanceTotalAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Suma deducerilor la nivelul documentului (BT-107) este 2.
|
||||
#The allowed maximum number of decimals for the Sum of allowances on document level(BT-107) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-11" flag="fatal" test="string-length(substring-after(cbc:ChargeTotalAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Suma taxelor suplimentare la nivelul documentului (BT-108) este 2.
|
||||
#The allowed maximum number of decimals for the Sum of charges on document level(BT-108) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-12" flag="fatal" test="string-length(substring-after(cbc:TaxExclusiveAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea totala a facturii fara TVA (BT-109) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice total amount without VAT (BT-109) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-14" flag="fatal" test="string-length(substring-after(cbc:TaxInclusiveAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea totala a facturii cu TVA (BT-112) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice total amount with VAT (BT-112) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-16" flag="fatal" test="string-length(substring-after(cbc:PrepaidAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Suma platita (BT-113) este 2.
|
||||
#The allowed maximum number of decimals for the Paid amount(BT-113) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-17" flag="fatal" test="string-length(substring-after(cbc:PayableRoundingAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoare de rotunjire (BT-114) este 2.
|
||||
#The allowed maximum number of decimals for the Rounding amount(BT-114) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-18" flag="fatal" test="string-length(substring-after(cbc:PayableAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Suma de plata (BT-115) este 2.
|
||||
#The allowed maximum number of decimals for the Amount due for payment (BT-115) is 2.</assert>
|
||||
</rule>
|
||||
<rule context="/ubl:Invoice | cac:CreditNote">
|
||||
<assert id="BR-DEC-RO-13" flag="fatal" test="(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:DocumentCurrencyCode] and (string-length(substring-after(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:DocumentCurrencyCode],'.'))<=2)) or (not(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:DocumentCurrencyCode]))">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea totala a TVA a facturii (BT-110) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-15" flag="fatal" test="(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:TaxCurrencyCode] and (string-length(substring-after(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:TaxCurrencyCode],'.'))<=2)) or (not(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:TaxCurrencyCode]))">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea TVA totala a facturii în moneda de contabilizare (BT-111) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxTotal/cac:TaxSubtotal">
|
||||
<assert id="BR-DEC-RO-1009" flag="fatal" test="string-length(substring-after(cbc:TaxableAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Baza de calcul pentru categoria de TVA (BT-116) este 2.
|
||||
#The allowed maximum number of decimals for the VAT category taxable amount (BT-116) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-1010" flag="fatal" test="string-length(substring-after(cbc:TaxAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea TVA pentru fiecare categorie de TVA (BT-117) este 2.
|
||||
#The allowed maximum number of decimals for the VAT category tax amount (BT-117) is 2.</assert>
|
||||
</rule>
|
||||
<rule context="cac:InvoiceLine | cac:CreditNoteLine">
|
||||
<assert id="BR-DEC-RO-23" flag="fatal" test="string-length(substring-after(cbc:LineExtensionAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea neta a liniei facturii (BT-131) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.</assert>
|
||||
</rule>
|
||||
<rule context="//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()] | //cac:CreditNoteLine/cac:AllowanceCharge[cbc:ChargeIndicator = false()]">
|
||||
<assert id="BR-DEC-RO-24" flag="fatal" test="string-length(substring-after(cbc:Amount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea deducerii la linia facturii (BT-136) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice line allowance amount (BT-136) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-25" flag="fatal" test="string-length(substring-after(cbc:BaseAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea de baza a deducerii la linia facturii (BT-137) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice line allowance base amount (BT-137) is 2.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:AllowanceChargeReason)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1022"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Motivul deducerii la linia facturii (BT-139) este 100.
|
||||
#The allowed maximum number of characters for the Invoice line allowance reason (BT-139) is 100.</assert>
|
||||
</rule>
|
||||
<rule context="//cac:InvoiceLine/cac:AllowanceCharge[cbc:ChargeIndicator = true()] | //cac:CreditNoteLine/cac:AllowanceCharge[cbc:ChargeIndicator = true()]">
|
||||
<assert id="BR-DEC-RO-27" flag="fatal" test="string-length(substring-after(cbc:Amount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea taxei suplimentare la linia facturii (BT-141) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice line charge amount (BT-141) is 2.</assert>
|
||||
<assert id="BR-DEC-RO-28" flag="fatal" test="string-length(substring-after(cbc:BaseAmount,'.'))<=2">
|
||||
[BR-RO-Z2]-Numarul maxim permis de zecimale pentru Valoarea de baza a taxei suplimentare la linia facturii (BT-142) este 2.
|
||||
#The allowed maximum number of decimals for the Invoice line charge base amount (BT-142) is 2.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:AllowanceChargeReason)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1023"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Motivul taxei suplimentare la linia facturii (BT-144) este 100.
|
||||
#The allowed maximum number of characters for the Invoice line charge reason (BT-144) is 100.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:Note">
|
||||
<assert test="string-length(normalize-space(.)) <= 300"
|
||||
flag="fatal"
|
||||
id="BR-RO-L302"
|
||||
>[BR-RO-L300]-Numarul maxim permis de caractere pentru Comentariu în factura (BT-22) este 300.
|
||||
#The allowed maximum number of characters for the Invoice note (BT-22) is 300.</assert>
|
||||
</rule>
|
||||
<rule context="//cac:AdditionalDocumentReference">
|
||||
<assert test="count(.) <= 50"
|
||||
flag="fatal"
|
||||
id="BR-RO-A051"
|
||||
>[BR-RO-A050]-O factura trebuie sa contina maximum 50 de aparitii ale grupului Documente justificative suplimentare (BG-24).
|
||||
#The allowed maximum number of occurences of Additional supporting documents (BG-24) is 50</assert>
|
||||
<assert test="string-length(normalize-space(cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L0308"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Identificatorul obiectului facturat (BT-18) si Referinta documentului justificativ (BT-122) este 200.
|
||||
#The allowed maximum number of characters for the Invoiced object identifier (BT-18) and the Supporting document reference(BT-122)is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cbc:DocumentDescription)) <= 100"
|
||||
flag="fatal"
|
||||
id="BR-RO-L1020"
|
||||
>[BR-RO-L100]-Numarul maxim permis de caractere pentru Descrierea documentului justificativ (BT-123) este 100.
|
||||
#The allowed maximum number of characters for the Supporting document description (BT-123) is 100.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Attachment/cac:ExternalReference/cbc:URI)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L210"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Localizarea documentului extern (BT-124), este 200.
|
||||
#The allowed maximum number of characters for the External document location (BT-124) is 200.</assert>
|
||||
<assert test="string-length(normalize-space(cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L211"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Numele fisierului documentului atasat (BT-125-2), este 200.
|
||||
#The allowed maximum number of characters for the Attached document Filename (BT-125-2) is 200.</assert>
|
||||
</rule>
|
||||
<rule context="//cac:BillingReference">
|
||||
<assert test="count(cac:InvoiceDocumentReference) <= 500"
|
||||
flag="fatal"
|
||||
id="BR-RO-A500"
|
||||
>[BR-RO-A500]-O factura trebuie sa contina maximum 500 de aparitii ale grupului Referinta la o factura anterioara (BG-3).
|
||||
#The allowed maximum number of occurences of Preceding invoice reference (BG-3) is 500.</assert>
|
||||
|
||||
<assert test="string-length(normalize-space(cac:InvoiceDocumentReference/cbc:ID)) <= 200"
|
||||
flag="fatal"
|
||||
id="BR-RO-L156"
|
||||
>[BR-RO-L200]-Numarul maxim permis de caractere pentru Referinta la o factura anterioara (BT-25) este 200.
|
||||
#The allowed maximum number of characters for the Preceding Invoice number (BT-25) is 200.</assert>
|
||||
|
||||
</rule>
|
||||
</pattern>
|
||||
</schema>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,123 @@
|
|||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Services\EDocument\Standards\Validation;
|
||||
|
||||
class XsltDocumentValidator
|
||||
{
|
||||
private array $stylesheets = [
|
||||
'/Services/EDocument/Standards/Validation/Peppol/Stylesheets/CEN-EN16931-UBL.xslt',
|
||||
'/Services/EDocument/Standards/Validation/Peppol/Stylesheets/PEPPOL-EN16931-UBL.xslt',
|
||||
];
|
||||
|
||||
private string $ubl_xsd = 'app/Services/EDocument/Standards/Validation/Peppol/Stylesheets/UBL2.1/UBL-Invoice-2.1.xsd';
|
||||
|
||||
private array $errors = [];
|
||||
|
||||
public function __construct(public string $xml_document)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the XSLT document
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function validate(): self
|
||||
{
|
||||
$this->validateXsd()
|
||||
->validateSchema();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function validateSchema(): self
|
||||
{
|
||||
|
||||
try{
|
||||
$processor = new \Saxon\SaxonProcessor();
|
||||
|
||||
$xslt = $processor->newXslt30Processor();
|
||||
|
||||
foreach($this->stylesheets as $stylesheet)
|
||||
{
|
||||
$xdmNode = $processor->parseXmlFromString($this->xml_document);
|
||||
|
||||
/** @var \Saxon\XsltExecutable $xsltExecutable */
|
||||
$xsltExecutable = $xslt->compileFromFile(app_path($stylesheet)); //@phpstan-ignore-line
|
||||
$result = $xsltExecutable->transformToValue($xdmNode);
|
||||
|
||||
for ($x = 0; $x < $result->size(); $x++)
|
||||
{
|
||||
|
||||
$a = $result->itemAt($x);
|
||||
|
||||
$this->errors['stylesheet'][] = $a->getStringValue();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch(\Exception $e){
|
||||
|
||||
$this->errors['general'][] = $e->getMessage();
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
private function validateXsd(): self
|
||||
{
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
|
||||
$xml = new \DOMDocument();
|
||||
$xml->loadXML($this->xml_document);
|
||||
|
||||
if (!$xml->schemaValidate($this->ubl_xsd)) {
|
||||
$errors = libxml_get_errors();
|
||||
libxml_clear_errors();
|
||||
|
||||
$errorMessages = [];
|
||||
foreach ($errors as $error) {
|
||||
$this->errors['xsd'] = sprintf(
|
||||
'Line %d: %s',
|
||||
$error->line,
|
||||
trim($error->message)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setStyleSheets(array $stylesheets): self
|
||||
{
|
||||
$this->stylesheets = $stylesheets;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStyleSheets(): array
|
||||
{
|
||||
return $this->stylesheets;
|
||||
}
|
||||
|
||||
public function getErrors(): array
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -535,16 +535,16 @@
|
|||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.324.12",
|
||||
"version": "3.324.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "c4aea23ee93e4567e353a0f3b907d154056bf4f6"
|
||||
"reference": "781cb9594f7d1754c888452f980748115fd159d3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c4aea23ee93e4567e353a0f3b907d154056bf4f6",
|
||||
"reference": "c4aea23ee93e4567e353a0f3b907d154056bf4f6",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/781cb9594f7d1754c888452f980748115fd159d3",
|
||||
"reference": "781cb9594f7d1754c888452f980748115fd159d3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -627,9 +627,9 @@
|
|||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.324.12"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.324.13"
|
||||
},
|
||||
"time": "2024-10-28T18:07:02+00:00"
|
||||
"time": "2024-10-29T18:11:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "babenkoivan/elastic-adapter",
|
||||
|
|
@ -15858,16 +15858,16 @@
|
|||
},
|
||||
{
|
||||
"name": "barryvdh/laravel-ide-helper",
|
||||
"version": "v3.2.1",
|
||||
"version": "v3.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-ide-helper.git",
|
||||
"reference": "800e2347a6ecf997200f447c9fdbe3dce3a797f3"
|
||||
"reference": "07e3bd8796f3d1414801a03d3783f9d3ec9efc08"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/800e2347a6ecf997200f447c9fdbe3dce3a797f3",
|
||||
"reference": "800e2347a6ecf997200f447c9fdbe3dce3a797f3",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/07e3bd8796f3d1414801a03d3783f9d3ec9efc08",
|
||||
"reference": "07e3bd8796f3d1414801a03d3783f9d3ec9efc08",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -15936,7 +15936,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/barryvdh/laravel-ide-helper/issues",
|
||||
"source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.2.1"
|
||||
"source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.2.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -15948,7 +15948,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-10-28T11:32:31+00:00"
|
||||
"time": "2024-10-29T14:00:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "barryvdh/reflection-docblock",
|
||||
|
|
@ -16955,16 +16955,16 @@
|
|||
},
|
||||
{
|
||||
"name": "maximebf/debugbar",
|
||||
"version": "v1.23.2",
|
||||
"version": "v1.23.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/maximebf/php-debugbar.git",
|
||||
"reference": "689720d724c771ac4add859056744b7b3f2406da"
|
||||
"reference": "687400043d77943ef95e8417cb44e1673ee57844"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/689720d724c771ac4add859056744b7b3f2406da",
|
||||
"reference": "689720d724c771ac4add859056744b7b3f2406da",
|
||||
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/687400043d77943ef95e8417cb44e1673ee57844",
|
||||
"reference": "687400043d77943ef95e8417cb44e1673ee57844",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -17017,9 +17017,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/maximebf/php-debugbar/issues",
|
||||
"source": "https://github.com/maximebf/php-debugbar/tree/v1.23.2"
|
||||
"source": "https://github.com/maximebf/php-debugbar/tree/v1.23.3"
|
||||
},
|
||||
"time": "2024-09-16T11:23:09+00:00"
|
||||
"time": "2024-10-29T12:24:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mockery/mockery",
|
||||
|
|
|
|||
|
|
@ -319,7 +319,101 @@ class PeppolTest extends TestCase
|
|||
|
||||
$this->assertCount(0, $errors);
|
||||
|
||||
$peppol->toXml();
|
||||
$xml = $peppol->toXml();
|
||||
// nlog($xml);
|
||||
|
||||
$cen = base_path('/tests/Feature/EInvoice/Validation/CEN-EN16931-UBL.xslt');
|
||||
$pep = base_path('/tests/Feature/EInvoice/Validation/PEPPOL-EN16931-UBL.xslt');
|
||||
|
||||
$stylesheet = base_path('/tests/Feature/EInvoice/Validation/stylesheet.xslt');
|
||||
|
||||
$peppol_stylesheet = base_path('/tests/Feature/EInvoice/Validation/peppol.xslt');
|
||||
$pep_test = base_path('tests/Feature/EInvoice/Validation/peppol_test.xml');
|
||||
|
||||
$pschema = base_path('tests/Feature/EInvoice/Validation/PEPPOL-EN16931-UBL.sch');
|
||||
|
||||
|
||||
// try{
|
||||
// $processor = new \Saxon\SaxonProcessor();
|
||||
|
||||
// $f = file_get_contents($pep_test);
|
||||
// $xmlFile = $f;
|
||||
// // $xslt = file_get_contents($cen);
|
||||
|
||||
|
||||
// $schematronFile = base_path('tests/Feature/EInvoice/Validation/PEPPOL-EN16931-UBL.sch');
|
||||
|
||||
// $xslt = $processor->newXslt30Processor(); // Changed to newXsltProcessor
|
||||
|
||||
|
||||
// $x = $xslt->compileFromFile($pep);
|
||||
// $result = $x->transformFileToString($pep_test);
|
||||
// nlog($result);
|
||||
|
||||
// $x = $xslt->compileFromFile($cen);
|
||||
// $result = $x->transformFileToString($pep_test);
|
||||
// $y = $x->transformFileToValue($pep_test);
|
||||
// nlog($result);
|
||||
// nlog($y);
|
||||
|
||||
|
||||
|
||||
// // $result = $xslt->transformFileToString($pep_test, $peppol_stylesheet); //output to strings
|
||||
|
||||
// // nlog("success");
|
||||
// nlog($result);
|
||||
// // nlog($result->getErrorMessage());
|
||||
|
||||
// } catch (Exception $e) {
|
||||
// nlog([
|
||||
// 'valid' => false,
|
||||
// 'message' => $e->getMessage()
|
||||
// ]);
|
||||
// }
|
||||
|
||||
|
||||
// try {
|
||||
// $xslt = $processor->newXslt30Processor();
|
||||
// // $xslt->compileFromFile($cen); // Changed to compileFromString since we have the file content
|
||||
|
||||
// // Attempt transformation to validate
|
||||
// $result = $xslt->transformFileToString($xml,$cen);
|
||||
|
||||
// nlog([
|
||||
// 'valid' => true,
|
||||
// 'message' => 'XSLT is valid'
|
||||
// ]);
|
||||
|
||||
// } catch (Exception $e) {
|
||||
// nlog([
|
||||
// 'valid' => false,
|
||||
// 'message' => $e->getMessage()
|
||||
// ]);
|
||||
// }
|
||||
|
||||
// try {
|
||||
// $xslt = $processor->newXslt30Processor(); // Changed to newXsltProcessor
|
||||
// $xslt->compileFromString($cen);
|
||||
|
||||
// // Attempt transformation to validate
|
||||
// $result = $xslt->transformFileToString($xml);
|
||||
|
||||
// nlog([
|
||||
// 'valid' => true,
|
||||
// 'message' => 'XSLT is valid'
|
||||
// ]);
|
||||
|
||||
// } catch (Exception $e) {
|
||||
// nlog([
|
||||
// 'valid' => false,
|
||||
// 'message' => $e->getMessage()
|
||||
// ]);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,582 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This schematron uses business terms defined the CEN/EN16931-1 and is reproduced with permission from CEN. CEN bears no liability from the use of the content and implementation of this schematron and gives no warranties expressed or implied for any purpose.
|
||||
|
||||
Last update: 2024 May release 3.0.17.
|
||||
-->
|
||||
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:u="utils" schemaVersion="iso" queryBinding="xslt2">
|
||||
<title>Rules for PEPPOL BIS 3.0 Billing</title>
|
||||
<ns uri="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" prefix="rsm"/>
|
||||
<ns uri="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" prefix="udt"/>
|
||||
<ns uri="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" prefix="qdt"/>
|
||||
<ns uri="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" prefix="ram"/>
|
||||
<ns uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
|
||||
<ns uri="utils" prefix="u"/>
|
||||
<!-- Parameters -->
|
||||
<let name="profile" value="
|
||||
if (/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter and matches(normalize-space(/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID), 'urn:fdc:peppol.eu:2017:poacc:billing:([0-9]{2}):1.0')) then
|
||||
tokenize(normalize-space(/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID), ':')[7]
|
||||
else
|
||||
'Unknown'"/>
|
||||
<let name="supplierCountry" value="
|
||||
if (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeAgreement[1]/ram:SellerTradeParty[1]/ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/substring(ram:ID, 1, 2)) then
|
||||
upper-case(normalize-space(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeAgreement[1]/ram:SellerTradeParty[1]/ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/substring(ram:ID, 1, 2)))
|
||||
else
|
||||
if (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/substring(ram:ID, 1, 2)) then
|
||||
upper-case(normalize-space(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/substring(ram:ID, 1, 2)))
|
||||
else
|
||||
if (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID) then
|
||||
upper-case(normalize-space(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID))
|
||||
else
|
||||
'XX'"/>
|
||||
<!-- -->
|
||||
<let name="documentCurrencyCode" value="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode"/>
|
||||
<let name="taxCurrencyCode" value="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode"/>
|
||||
<!-- Functions -->
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:gln" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="length" select="string-length($val) - 1"/>
|
||||
<variable name="digits" select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
||||
<variable name="weightedSum" select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (1 + ((($i + 1) mod 2) * 2)))"/>
|
||||
<value-of select="(10 - ($weightedSum mod 10)) mod 10 = number(substring($val, $length + 1, 1))"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:slack" as="xs:boolean">
|
||||
<param name="exp" as="xs:decimal"/>
|
||||
<param name="val" as="xs:decimal"/>
|
||||
<param name="slack" as="xs:decimal"/>
|
||||
<value-of select="xs:decimal($exp + $slack) >= $val and xs:decimal($exp - $slack) <= $val"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:mod11" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="length" select="string-length($val) - 1"/>
|
||||
<variable name="digits" select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
||||
<variable name="weightedSum" select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (($i mod 6) + 2))"/>
|
||||
<value-of select="number($val) > 0 and (11 - ($weightedSum mod 11)) mod 11 = number(substring($val, $length + 1, 1))"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:mod97-0208" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="checkdigits" select="substring($val,9,2)"/>
|
||||
<variable name="calculated_digits" select="xs:string(97 - (xs:integer(substring($val,1,8)) mod 97))"/>
|
||||
<value-of select="number($checkdigits) = number($calculated_digits)"/>
|
||||
</function>
|
||||
<function name="u:checkCodiceIPA" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789</variable>
|
||||
<sequence select="if ( (string-length(translate($arg, $allowed-characters, '')) = 0) and (string-length($arg) = 6) ) then true() else false()"/>
|
||||
</function>
|
||||
<function name="u:checkCF" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<sequence select="
|
||||
if ( (string-length($arg) = 16) or (string-length($arg) = 11) )
|
||||
then
|
||||
(
|
||||
if ((string-length($arg) = 16))
|
||||
then
|
||||
(
|
||||
if (u:checkCF16($arg))
|
||||
then
|
||||
(
|
||||
true()
|
||||
)
|
||||
else
|
||||
(
|
||||
false()
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
if(($arg castable as xs:integer)) then true() else false()
|
||||
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
false()
|
||||
)
|
||||
"/>
|
||||
</function>
|
||||
<function name="u:checkCF16" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</variable>
|
||||
<sequence select="
|
||||
if ( (string-length(translate(substring($arg,1,6), $allowed-characters, '')) = 0) and
|
||||
(substring($arg,7,2) castable as xs:integer) and
|
||||
(string-length(translate(substring($arg,9,1), $allowed-characters, '')) = 0) and
|
||||
(substring($arg,10,2) castable as xs:integer) and
|
||||
(substring($arg,12,3) castable as xs:string) and
|
||||
(substring($arg,15,1) castable as xs:integer) and
|
||||
(string-length(translate(substring($arg,16,1), $allowed-characters, '')) = 0)
|
||||
)
|
||||
then true()
|
||||
else false()
|
||||
"/>
|
||||
</function>
|
||||
<function name="u:checkPIVAseIT" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string"/>
|
||||
<variable name="paese" select="substring($arg,1,2)"/>
|
||||
<variable name="codice" select="substring($arg,3)"/>
|
||||
<sequence select="
|
||||
|
||||
if ( $paese = 'IT' or $paese = 'it' )
|
||||
then
|
||||
(
|
||||
if ( ( string-length($codice) = 11 ) and ( if (u:checkPIVA($codice)!=0) then false() else true() ))
|
||||
then
|
||||
(
|
||||
true()
|
||||
)
|
||||
else
|
||||
(
|
||||
false()
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
true()
|
||||
)
|
||||
|
||||
"/>
|
||||
</function>
|
||||
<function name="u:checkPIVA" as="xs:integer" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<sequence select="
|
||||
if (not($arg castable as xs:integer))
|
||||
then 1
|
||||
else ( u:addPIVA($arg,xs:integer(0)) mod 10 )"/>
|
||||
</function>
|
||||
<function name="u:addPIVA" as="xs:integer" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string"/>
|
||||
<param name="pari" as="xs:integer"/>
|
||||
<variable name="tappo" select="if (not($arg castable as xs:integer)) then 0 else 1"/>
|
||||
<variable name="mapper" select="if ($tappo = 0) then 0 else
|
||||
( if ($pari = 1)
|
||||
then ( xs:integer(substring('0246813579', ( xs:integer(substring($arg,1,1)) +1 ) ,1)) )
|
||||
else ( xs:integer(substring($arg,1,1) ) )
|
||||
)"/>
|
||||
<sequence select="if ($tappo = 0) then $mapper else ( xs:integer($mapper) + u:addPIVA(substring(xs:string($arg),2), (if($pari=0) then 1 else 0) ) )"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:abn" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<value-of select="(
|
||||
((string-to-codepoints(substring($val,1,1)) - 49) * 10) +
|
||||
((string-to-codepoints(substring($val,2,1)) - 48) * 1) +
|
||||
((string-to-codepoints(substring($val,3,1)) - 48) * 3) +
|
||||
((string-to-codepoints(substring($val,4,1)) - 48) * 5) +
|
||||
((string-to-codepoints(substring($val,5,1)) - 48) * 7) +
|
||||
((string-to-codepoints(substring($val,6,1)) - 48) * 9) +
|
||||
((string-to-codepoints(substring($val,7,1)) - 48) * 11) +
|
||||
((string-to-codepoints(substring($val,8,1)) - 48) * 13) +
|
||||
((string-to-codepoints(substring($val,9,1)) - 48) * 15) +
|
||||
((string-to-codepoints(substring($val,10,1)) - 48) * 17) +
|
||||
((string-to-codepoints(substring($val,11,1)) - 48) * 19)) mod 89 = 0
|
||||
"/>
|
||||
</function>
|
||||
|
||||
<!-- Function for Swedish organisation numbers (0007) -->
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkSEOrgnr" as="xs:boolean">
|
||||
<param name="number" as="xs:string"/>
|
||||
<choose>
|
||||
<!-- Check if input is numeric -->
|
||||
<when test="not(matches($number, '^\d+$'))">
|
||||
<sequence select="false()"/>
|
||||
</when>
|
||||
<otherwise>
|
||||
<!-- verify the check number of the provided identifier according to the Luhn algorithm-->
|
||||
<variable name="mainPart" select="substring($number, 1, 9)"/>
|
||||
<variable name="checkDigit" select="substring($number, 10, 1)"/>
|
||||
<variable name="sum" as="xs:integer">
|
||||
<value-of select="sum(
|
||||
for $pos in 1 to string-length($mainPart) return
|
||||
if ($pos mod 2 = 1)
|
||||
then (number(substring($mainPart, string-length($mainPart) - $pos + 1, 1)) * 2) mod 10 +
|
||||
(number(substring($mainPart, string-length($mainPart) - $pos + 1, 1)) * 2) idiv 10
|
||||
else number(substring($mainPart, string-length($mainPart) - $pos + 1, 1))
|
||||
)"/>
|
||||
</variable>
|
||||
<variable name="calculatedCheckDigit" select="(10 - $sum mod 10) mod 10"/>
|
||||
<sequence select="$calculatedCheckDigit = number($checkDigit)"/>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</function>
|
||||
|
||||
<pattern>
|
||||
<rule context="rsm:ExchangedDocumentContext">
|
||||
<assert id="PEPPOL-EN16931-R001" test="ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID" flag="fatal">Business process MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R007" test="$profile != 'Unknown'" flag="fatal">Business process MUST be in the format 'urn:fdc:peppol.eu:2017:poacc:billing:NN:1.0' where NN indicates the process number.</assert>
|
||||
<assert id="PEPPOL-EN16931-R004" test="starts-with(normalize-space(ram:GuidelineSpecifiedDocumentContextParameter/ram:ID/text()), 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0')" flag="fatal">Specification identifier MUST have the value 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'.</assert>
|
||||
</rule>
|
||||
<rule context="ram:ApplicableHeaderTradeAgreement">
|
||||
<assert id="PEPPOL-EN16931-R003" test="ram:BuyerReference or ram:BuyerOrderReferencedDocument/ram:IssuerAssignedID" flag="fatal">A buyer reference or purchase order reference MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R006" test="count(ram:AdditionalReferencedDocument[ram:TypeCode='130']) <=1" flag="fatal">Only one invoiced object is allowed on document level</assert>
|
||||
<assert id="PEPPOL-EN16931-R080" test="count(ram:AdditionalReferencedDocument[ram:TypeCode='50']) <=1" flag="fatal">Only one project reference is allowed on document level</assert>
|
||||
</rule>
|
||||
<rule context="ram:ApplicableHeaderTradeSettlement">
|
||||
<assert id="PEPPOL-EN16931-R005" test="not(ram:TaxCurrencyCode) or normalize-space(ram:TaxCurrencyCode/text()) != normalize-space(ram:InvoiceCurrencyCode/text())" flag="fatal">VAT accounting currency code MUST be different from invoice currency code when provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R053" test="count(ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $documentCurrencyCode]) = 1" flag="fatal">Only one tax total with tax subtotals MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R054" test="
|
||||
count(ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID != $documentCurrencyCode]) = (if (ram:TaxCurrencyCode) then
|
||||
1
|
||||
else
|
||||
0)" flag="fatal">Only one tax total without tax subtotals MUST be provided when tax currency code is provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R055" test="not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode) or (ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $taxCurrencyCode] < 0 and ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $documentCurrencyCode] < 0) or (ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $taxCurrencyCode] >= 0 and ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID = $documentCurrencyCode] >= 0)" flag="fatal">Invoice total VAT amount and Invoice total VAT amount in accounting currency MUST have the same operational sign</assert>
|
||||
</rule>
|
||||
<!-- PEPPOL-EN16931-R051 is obsolete in CII. -->
|
||||
<rule context="rsm:ExchangedDocument">
|
||||
<assert id="PEPPOL-EN16931-R002" test="count(ram:IncludedNote) <= 1 and not(ram:IncludedNote/ram:SubjectCode)" flag="fatal">No more than one note is allowed on document level.</assert>
|
||||
</rule>
|
||||
<rule context="ram:BuyerTradeParty">
|
||||
<assert id="PEPPOL-EN16931-R010" test="ram:URIUniversalCommunication/ram:URIID" flag="fatal">Buyer electronic address MUST be provided</assert>
|
||||
</rule>
|
||||
<rule context="ram:SellerTradeParty">
|
||||
<assert id="PEPPOL-EN16931-R020" test="ram:URIUniversalCommunication/ram:URIID" flag="fatal">Seller electronic address MUST be provided</assert>
|
||||
</rule>
|
||||
<rule context="ram:SpecifiedTradeAllowanceCharge[ram:CalculationPercent and not(ram:BasisAmount)]">
|
||||
<assert id="PEPPOL-EN16931-R041" test="false()" flag="fatal">Allowance/charge base
|
||||
amount MUST be provided when allowance/charge percentage is provided.</assert>
|
||||
</rule>
|
||||
<rule context="ram:SpecifiedTradeAllowanceCharge[not(ram:CalculationPercent) and ram:BasisAmount]">
|
||||
<assert id="PEPPOL-EN16931-R042" test="false()" flag="fatal">Allowance/charge percentage
|
||||
MUST be provided when allowance/charge base amount is provided.</assert>
|
||||
</rule>
|
||||
<rule context="ram:SpecifiedTradeAllowanceCharge">
|
||||
<assert id="PEPPOL-EN16931-R040" test="
|
||||
not(ram:CalculationPercent and ram:BasisAmount) or u:slack(if (ram:ActualAmount) then
|
||||
ram:ActualAmount
|
||||
else
|
||||
0, (xs:decimal(ram:BasisAmount) * xs:decimal(ram:CalculationPercent)) div 100, 0.02)" flag="fatal">Allowance/charge amount must equal base amount * percentage/100 if base amount and percentage exists</assert>
|
||||
<assert id="PEPPOL-EN16931-R043" test="normalize-space(ram:ChargeIndicator/udt:Indicator/text()) = 'true' or normalize-space(ram:ChargeIndicator/udt:Indicator/text()) = 'false'" flag="fatal">Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'</assert>
|
||||
</rule>
|
||||
<rule context="ram:AppliedTradeAllowanceCharge">
|
||||
<assert id="PEPPOL-EN16931-R043" test="normalize-space(ram:ChargeIndicator/udt:Indicator/text()) = 'true' or normalize-space(ram:ChargeIndicator/udt:Indicator/text()) = 'false'" flag="fatal">Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'</assert>
|
||||
</rule>
|
||||
<rule context="
|
||||
ram:SpecifiedTradeSettlementPaymentMeans[some $code in tokenize('49 59', '\s')
|
||||
satisfies normalize-space(ram:TypeCode) = $code]">
|
||||
<assert id="PEPPOL-EN16931-R061" test="../ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID" flag="fatal">Mandate reference MUST be provided for direct debit.</assert>
|
||||
</rule>
|
||||
<rule context="rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ram:StartDateTime]/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:BillingSpecifiedPeriod/ram:StartDateTime">
|
||||
<assert id="PEPPOL-EN16931-R110" test="udt:DateTimeString >= ../../../../ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ram:StartDateTime/udt:DateTimeString" flag="fatal">Start date of line period MUST be within invoice period.</assert>
|
||||
</rule>
|
||||
<rule context="rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ram:EndDateTime]/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:BillingSpecifiedPeriod/ram:EndDateTime">
|
||||
<assert id="PEPPOL-EN16931-R111" test="udt:DateTimeString <= ../../../../ram:ApplicableHeaderTradeSettlement/ram:BillingSpecifiedPeriod/ram:EndDateTime/udt:DateTimeString" flag="fatal">End date of line period MUST be within invoice period.</assert>
|
||||
</rule>
|
||||
<rule context="ram:IncludedSupplyChainTradeLineItem">
|
||||
<let name="lineExtensionAmount" value="
|
||||
if (ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount) then
|
||||
xs:decimal(ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount)
|
||||
else
|
||||
0"/>
|
||||
<let name="quantity" value="
|
||||
if (ram:SpecifiedLineTradeDelivery/ram:BilledQuantity) then
|
||||
xs:decimal(ram:SpecifiedLineTradeDelivery/ram:BilledQuantity)
|
||||
else
|
||||
1"/>
|
||||
<let name="priceAmount" value="
|
||||
if (ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:ChargeAmount) then
|
||||
xs:decimal(ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:ChargeAmount)
|
||||
else
|
||||
0"/>
|
||||
<let name="baseQuantity" value="
|
||||
if (ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:BasisQuantity and xs:decimal(ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:BasisQuantity) != 0) then
|
||||
xs:decimal(ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:BasisQuantity)
|
||||
else
|
||||
1"/>
|
||||
<let name="allowancesTotal" value="
|
||||
if (ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeAllowanceCharge[normalize-space(ram:ChargeIndicator/udt:Indicator) = 'false']) then
|
||||
round(sum(ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeAllowanceCharge[normalize-space(ram:ChargeIndicator/udt:Indicator) = 'false']/ram:ActualAmount/xs:decimal(.)) * 10 * 10) div 100
|
||||
else
|
||||
0"/>
|
||||
<let name="chargesTotal" value="
|
||||
if (ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeAllowanceCharge[normalize-space(ram:ChargeIndicator/udt:Indicator) = 'true']) then
|
||||
round(sum(ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeAllowanceCharge[normalize-space(ram:ChargeIndicator/udt:Indicator) = 'true']/ram:ActualAmount/xs:decimal(.)) * 10 * 10) div 100
|
||||
else
|
||||
0"/>
|
||||
<assert id="PEPPOL-EN16931-R120" test="u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, 0.02)" flag="fatal">Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount</assert>
|
||||
<assert id="PEPPOL-EN16931-R100" test="count(ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument[ram:TypeCode='130']) <=1" flag="fatal">Only one invoiced object is allowed pr line</assert>
|
||||
<assert id="PEPPOL-EN16931-R101" test="(not(ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument) or (ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument/ram:TypeCode='130'))" flag="fatal">Element Document reference can only be used for Invoice line object</assert>
|
||||
</rule>
|
||||
<rule context="ram:NetPriceProductTradePrice | ram:GrossPriceProductTradePrice">
|
||||
<assert id="PEPPOL-EN16931-R121" test="not(ram:BasisQuantity) or xs:decimal(ram:BasisQuantity) > 0" flag="fatal">Base quantity MUST be a positive number above zero.</assert>
|
||||
</rule>
|
||||
<!-- PEPPOL-EN16931-R044 and PEPPOL-EN16931-R046 are not needed due to lack of elements for the EN. -->
|
||||
<!-- Price -->
|
||||
<rule context="ram:NetPriceProductTradePrice/ram:BasisQuantity[@unitCode] | ram:GrossPriceProductTradePrice/ram:BasisQuantity[@unitCode]">
|
||||
<assert id="PEPPOL-EN16931-R130" test="@unitCode = ../../../ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode" flag="fatal">Unit code of price base quantity MUST be same as invoiced quantity.</assert>
|
||||
</rule>
|
||||
<!-- Validation of ICD -->
|
||||
<rule context="ram:URIID[@schemeID = '0088'] | ram:ID[@schemeID = '0088'] | ram:GlobalID[@schemeID = '0088']">
|
||||
<assert id="PEPPOL-COMMON-R040" test="matches(normalize-space(), '^[0-9]+$') and u:gln(normalize-space())" flag="fatal">GLN must have a valid format according to GS1 rules.</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0192'] | ram:ID[@schemeID = '0192'] | ram:GlobalID[@schemeID = '0192']">
|
||||
<assert id="PEPPOL-COMMON-R041" test="matches(normalize-space(), '^[0-9]{9}$') and u:mod11(normalize-space())" flag="fatal">Norwegian organization number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0184'] | ram:ID[@schemeID = '0184'] | ram:GlobalID[@schemeID = '0184']">
|
||||
<assert id="PEPPOL-COMMON-R042" test="(string-length(text()) = 10) and (substring(text(), 1, 2) = 'DK') and (string-length(translate(substring(text(), 3, 8), '1234567890', '')) = 0)" flag="fatal">Danish organization number (CVR) MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0208'] | ram:ID[@schemeID = '0208'] | ram:GlobalID[@schemeID = '0208']">
|
||||
<assert id="PEPPOL-COMMON-R043" test="matches(normalize-space(), '^[0-9]{10}$') and u:mod97-0208(normalize-space())" flag="fatal">Belgian enterprise number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0201'] | ram:ID[@schemeID = '0201'] | ram:GlobalID[@schemeID = '0201']">
|
||||
<assert id="PEPPOL-COMMON-R044" test="u:checkCodiceIPA(normalize-space())" flag="warning">IPA Code (Codice Univoco Unità Organizzativa) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0210'] | ram:ID[@schemeID = '0210'] | ram:GlobalID[@schemeID = '0210']">
|
||||
<assert id="PEPPOL-COMMON-R045" test="u:checkCF(normalize-space())" flag="warning">Tax Code (Codice Fiscale) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '9907']">
|
||||
<assert id="PEPPOL-COMMON-R046" test="u:checkCF(normalize-space())" flag="warning">Tax Code (Codice Fiscale) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0211'] | ram:ID[@schemeID = '0211'] | ram:GlobalID[@schemeID = '0211']">
|
||||
<assert id="PEPPOL-COMMON-R047" test="u:checkPIVAseIT(normalize-space())" flag="warning">Italian VAT Code (Partita Iva) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '9906']">
|
||||
<assert id="PEPPOL-COMMON-R048" test="u:checkPIVAseIT(normalize-space())" flag="warning">Italian VAT Code (Partita Iva) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0007'] | ram:ID[@schemeID = '0007'] | ram:GlobalID[@schemeID = '0007']">
|
||||
<assert id="PEPPOL-COMMON-R049" test="string-length(normalize-space()) = 10 and string(number(normalize-space())) != 'NaN' and u:checkSEOrgnr(normalize-space())" flag="fatal">Swedish organization number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="ram:URIID[@schemeID = '0151'] | ram:ID[@schemeID = '0151'] | ram:GlobalID[@schemeID = '0151']">
|
||||
<assert id="PEPPOL-COMMON-R050" test="u:abn(normalize-space())" flag="fatal">Australian Business Number (ABN) MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
|
||||
</pattern>
|
||||
<!-- National rules -->
|
||||
<pattern>
|
||||
<!-- Norway -->
|
||||
<rule context="ram:SellerTradeParty[$supplierCountry = 'NO']">
|
||||
<assert id="NO-R-002" test="ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'FC'][normalize-space(text()) = 'Foretaksregisteret']" flag="warning">Most invoice issuers are required to append "Foretaksregisteret" to
|
||||
their invoice. "Dersom selger er aksjeselskap, allmennaksjeselskap eller filial av
|
||||
utenlandsk selskap skal også ordet «Foretaksregisteret» fremgå av salgsdokumentet,
|
||||
jf. foretaksregisterloven § 10-2."</assert>
|
||||
<assert id="NO-R-001" test="ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/substring(ram:ID, 1, 2)='NO' and matches(ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/substring(ram:ID,3) , '^[0-9]{9}MVA$')
|
||||
and u:mod11(substring(ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/ram:ID, 3, 9)) or not(ram:SpecifiedTaxRegistration[ram:ID/@schemeID = 'VAT']/substring(ram:ID, 1, 2)='NO')" flag="fatal">For Norwegian suppliers, a VAT number MUST be the country code prefix NO followed by a valid Norwegian organization number (nine numbers) followed by the letters MVA.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- DENMARK -->
|
||||
<pattern>
|
||||
<let name="DKSupplierCountry" value="rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID"/>
|
||||
<let name="DKCustomerCountry" value="rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID"/>
|
||||
<!-- Document level -->
|
||||
<rule context="rsm:CrossIndustryInvoice[$DKSupplierCountry = 'DK']">
|
||||
<!--Check for Legal entity-->
|
||||
<assert id="DK-R-002" test="(normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID/text()) != '')" flag="fatal">Danish suppliers MUST provide legal entity.</assert>
|
||||
<!--Check for Non VAT Tax code-->
|
||||
<assert id="DK-R-004" test="not((($DKCustomerCountry = 'DK') and (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:ReasonCode = 'ZZZ'))
|
||||
and not ((string-length(normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:Reason/text())) = 4
|
||||
and number(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:Reason) >= 0)
|
||||
and number(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:Reason <= 9999)
|
||||
)
|
||||
)" flag="fatal">When specifying non-VAT Taxes for Danish customers, Danish suppliers MUST use the SpecifiedTradeAllowanceCharge/ReasonCode="ZZZ" and the 4-digit Tax category MUST be specified as Reason</assert>
|
||||
<assert id="DK-R-013" test="not(($DKCustomerCountry = 'DK') and
|
||||
( ((boolean(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:GlobalID))
|
||||
and (normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:GlobalID/@schemeID) = ''))
|
||||
or
|
||||
((boolean(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:GlobalID))
|
||||
and (normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:GlobalID/@schemeID) = ''))
|
||||
)
|
||||
)" flag="fatal">For Danish Suppliers it is mandatory to use schemeID when GlobalID is used for SellerTradeParty or BuyerTradeParty</assert>
|
||||
<assert id="DK-R-014" test="not((boolean(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID))
|
||||
and (normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID/@schemeID) != '0184')
|
||||
)" flag="fatal">For Danish Suppliers it is mandatory to specify schemeID as "0184" when SpecifiedLegalOrganization is used for SellerTradeParty</assert>
|
||||
<assert id="DK-R-016" test="not((($DKCustomerCountry = 'DK') and (normalize-space(rsm:ExchangedDocument/ram:TypeCode/text()) = '381'))
|
||||
and (number(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:DuePayableAmount/text()) < 0)
|
||||
)" flag="fatal">For Danish Suppliers, a Credit note cannot have a negative total (DuePayableAmount)</assert>
|
||||
</rule>
|
||||
<rule context="rsm:CrossIndustryInvoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans">
|
||||
<assert id="DK-R-005" test="(contains(' 1 10 31 42 48 49 50 58 59 93 97 ', concat(' ', ram:TypeCode, ' ')))" flag="fatal">For Danish suppliers the following Payment means type codes are allowed: 1, 10, 31, 42, 48, 49, 50, 58, 59, 93 and 97</assert>
|
||||
<assert id="DK-R-006" test="not( ((ram:TypeCode = '31') or (ram:TypeCode = '42'))
|
||||
and not((normalize-space(ram:PayeePartyCreditorFinancialAccount/ram:IBANID/text()) != '') and (normalize-space(ram:PayeeSpecifiedCreditorFinancialInstitution/ram:BICID/text()) != ''))
|
||||
)" flag="fatal">For Danish suppliers, bank account and registration account are mandatory if payment means is 31 or 42</assert>
|
||||
<assert id="DK-R-007" test="not((ram:TypeCode = '49')
|
||||
and not((normalize-space(../ram:CreditorReferenceID/text()) != '')
|
||||
and (normalize-space(ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID/text()) != ''))
|
||||
)" flag="fatal">For Danish suppliers DirectDebitMandateID and CreditorReferenceID are mandatory when payment means is 49</assert>
|
||||
<assert id="DK-R-008" test="not((ram:TypeCode = '50')
|
||||
and not(((substring(../ram:PaymentReference, 0, 4) = '01#')
|
||||
or (substring(../ram:PaymentReference, 0, 4) = '04#')
|
||||
or (substring(../ram:PaymentReference, 0, 4) = '15#'))
|
||||
and (string-length(ram:PayeePartyCreditorFinancialAccount/ram:IBANID/text()) = 7)
|
||||
)
|
||||
)" flag="fatal">For Danish Suppliers PaymentReference is mandatory and MUST start with 01#, 04# or 15# (kortartkode), and PayeePartyCreditorFinancialAccount/IBANID (Giro kontonummer) is mandatory and must be 7 characters long, when payment means equals 50 (Giro)</assert>
|
||||
<assert id="DK-R-009" test="not((ram:TypeCode = '50')
|
||||
and ((substring(../ram:PaymentReference, 0, 4) = '04#')
|
||||
or (substring(../ram:PaymentReference, 0, 4) = '15#'))
|
||||
and not(string-length(../ram:PaymentReference) = 19)
|
||||
)" flag="fatal">For Danish Suppliers if the PaymentReference is prefixed with 04# or 015# the 16 digits instruction Id must be added to the PaymentReference eg. "04#1234567890123456" when Payment means equals 50 (Giro)</assert>
|
||||
<assert id="DK-R-010" test="not((ram:TypeCode = '93')
|
||||
and not(((substring(../ram:PaymentReference, 0, 4) = '71#')
|
||||
or (substring(../ram:PaymentReference, 0, 4) = '73#')
|
||||
or (substring(../ram:PaymentReference, 0, 4) = '75#'))
|
||||
and (string-length(ram:PayeePartyCreditorFinancialAccount/ram:IBANID/text()) = 8)
|
||||
)
|
||||
)" flag="fatal">For Danish Suppliers the PaymentReference is mandatory and MUST start with 71#, 73# or 75# (kortartkode) and and PayeePartyCreditorFinancialAccount/IBANID (Kreditornummer) is mandatory and must be exactly 8 characters long, when Payment means equals 93 (FIK)</assert>
|
||||
<assert id="DK-R-011" test="not((ram:TypeCode = '93')
|
||||
and ((substring(../ram:PaymentReference, 0, 4) = '71#')
|
||||
or (substring(../ram:PaymentReference, 0, 4) = '75#'))
|
||||
and not((string-length(../ram:PaymentReference) = 18)
|
||||
or (string-length(../ram:PaymentReference) = 19))
|
||||
)" flag="fatal">For Danish Suppliers if the PaymentReference is prefixed with 71# or 75# the 15-16 digits instruction Id must be added to the PaymentReference eg. "71#1234567890123456" when payment Method equals 93 (FIK)</assert>
|
||||
</rule>
|
||||
<rule context="rsm:CrossIndustryInvoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem">
|
||||
<!-- Chedk for commodityCode on linelevel -->
|
||||
<assert id="DK-R-003" test="not((ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listID = 'TST')
|
||||
and not((ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listVersionID = '19.05.01')
|
||||
or (ram:SpecifiedTradeProduct/ram:DesignatedProductClassification/ram:ClassCode/@listVersionID = '19.0501')
|
||||
)
|
||||
)" flag="warning">If ItemClassification is provided from Danish suppliers, UNSPSC version 19.0501 should be used</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- Italian rules -->
|
||||
<pattern>
|
||||
<rule context="ram:SellerTradeParty[$supplierCountry = 'IT']/ram:SpecifiedTaxRegistration">
|
||||
<assert id="IT-R-001" test=" ram:ID[normalize-space(@schemeID) !='FC'] or matches(normalize-space(ram:ID[normalize-space(@schemeID) ='FC']) ,'^[A-Z0-9]{11,16}$') " flag="fatal"> [IT-R-001] BT-32 (Seller tax registration identifier) - For Italian suppliers BT-32 minimum length 11 and maximum length shall be 16. Per i fornitori italiani il BT-32 deve avere una lunghezza tra 11 e 16 caratteri</assert>
|
||||
</rule>
|
||||
<rule context="ram:SellerTradeParty[$supplierCountry = 'IT']">
|
||||
<assert id="IT-R-002" test="(ram:PostalTradeAddress/ram:LineOne)" flag="fatal"> [IT-R-002] BT-35 (Seller address line 1) - Italian suppliers MUST provide the postal address line 1 - I fornitori italiani devono indicare l'indirizzo postale.</assert>
|
||||
<assert id="IT-R-003" test="(ram:PostalTradeAddress/ram:CityName)" flag="fatal"> [IT-R-003] BT-37 (Seller city) - Italian suppliers MUST provide the postal address city - I fornitori italiani devono indicare la città di residenza.</assert>
|
||||
<assert id="IT-R-004" test="(ram:PostalTradeAddress/ram:PostcodeCode)" flag="fatal"> [IT-R-004] BT-38 (Seller post code) - Italian suppliers MUST provide the postal address post code - I fornitori italiani devono indicare il CAP di residenza.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- Swedish rules -->
|
||||
<pattern>
|
||||
<rule context="rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE' and ram:SpecifiedTaxRegistration/substring(ram:ID[@schemeID = 'VAT'], 1, 2) = 'SE']">
|
||||
<assert id="SE-R-001" test="string-length(normalize-space(ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VAT'])) = 14" flag="fatal">For Swedish suppliers, Swedish VAT-numbers must consist of 14 characters.</assert>
|
||||
<assert id="SE-R-002" test="string(number(substring(ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VAT'], 3, 12))) != 'NaN'" flag="fatal">For Swedish suppliers, the Swedish VAT-numbers must have the trailing 12 characters in numeric form</assert>
|
||||
</rule>
|
||||
<rule context="rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization[../ram:PostalTradeAddress/ram:CountryID = 'SE' and ram:ID]">
|
||||
<assert id="SE-R-003" test="string(number(ram:ID)) != 'NaN'" flag="warning">Swedish organisation numbers should be numeric.</assert>
|
||||
<assert id="SE-R-004" test="string-length(normalize-space(ram:ID)) = 10" flag="warning">Swedish organisation numbers consist of 10 characters.</assert>
|
||||
<assert id="SE-R-013" test="u:checkSEOrgnr(normalize-space(ram:ID))" flag="warning">The last digit of a Swedish organization number must be valid according to the Luhn algorithm.</assert>
|
||||
</rule>
|
||||
<rule context="rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE' and ram:SpecifiedLegalOrganization/ram:ID]/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'FC']">
|
||||
<assert id="SE-R-005" test="normalize-space(upper-case(.)) = 'GODKÄND FÖR F-SKATT'" flag="fatal">For Swedish suppliers, when using Seller tax registration identifier, 'Godkänd för F-skatt' must be stated</assert>
|
||||
</rule>
|
||||
<rule context="//ram:ApplicableTradeTax[/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE']/ram:SpecifiedTaxRegistration[substring(ram:ID[@schemeID = 'VAT'], 1, 2) = 'SE']] | //ram:CategoryTradeTax[/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE']/ram:SpecifiedTaxRegistration[substring(ram:ID[@schemeID = 'VAT'], 1, 2) = 'SE']]">
|
||||
<assert id="SE-R-006" test="number(ram:RateApplicablePercent) = 25 or number(ram:RateApplicablePercent) = 12 or number(ram:RateApplicablePercent) = 6" flag="fatal">For Swedish suppliers, only standard VAT rate of 6, 12 or 25 are used</assert>
|
||||
</rule>
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE']]/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = '30' and normalize-space(ram:PayeeSpecifiedCreditorFinancialInstitution/ram:BICID) = 'SE:PLUSGIRO']/ram:PayeePartyCreditorFinancialAccount/ram:ProprietaryID">
|
||||
<assert id="SE-R-007" test="string(number(normalize-space(.))) != 'NaN'" flag="warning">For Swedish suppliers using Plusgiro, the Account ID must be numeric </assert>
|
||||
<assert id="SE-R-010" test="string-length(normalize-space(.)) >= 2 and string-length(normalize-space(.)) <= 8" flag="warning">For Swedish suppliers using Plusgiro, the Account ID must have 2-8 characters</assert>
|
||||
</rule>
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE']]/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = '30' and normalize-space(ram:PayeeSpecifiedCreditorFinancialInstitution/ram:BICID) = 'SE:BANKGIRO']/ram:PayeePartyCreditorFinancialAccount/ram:ProprietaryID">
|
||||
<assert id="SE-R-008" test="string(number(normalize-space(.))) != 'NaN'" flag="warning">For Swedish suppliers using Bankgiro, the Account ID must be numeric </assert>
|
||||
<assert id="SE-R-009" test="string-length(normalize-space(.)) = 7 or string-length(normalize-space(.)) = 8" flag="warning">For Swedish suppliers using Bankgiro, the Account ID must have 7-8 characters</assert>
|
||||
</rule>
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE']]/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = '50' or normalize-space(ram:TypeCode) = '56']">
|
||||
<assert id="SE-R-011" test="false()" flag="warning">For Swedish suppliers using Swedish Bankgiro or Plusgiro, the proper way to indicate this is to use Code 30 for PaymentMeans and FinancialInstitutionBranch ID with code SE:BANKGIRO or SE:PLUSGIRO</assert>
|
||||
</rule>
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction[ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE'] and ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty[ram:PostalTradeAddress/ram:CountryID = 'SE']]/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = '31']">
|
||||
<assert id="SE-R-012" test="false()" flag="warning">For domestic transactions between Swedish trading partners, credit transfer should be indicated by PaymentMeansCode=”30”</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- NETHERLANDS -->
|
||||
<pattern>
|
||||
<let name="supplierCountryIsNL" value="(upper-case(normalize-space(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID)) = 'NL')" />
|
||||
<let name="customerCountryIsNL" value="(upper-case(normalize-space(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID)) = 'NL')" />
|
||||
<let name="taxRepresentativeCountryIsNL" value="(upper-case(normalize-space(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:PostalTradeAddress/ram:CountryID)) = 'NL')" />
|
||||
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:ExchangedDocument[some $code in tokenize('81 83 381 396 532', '\s') satisfies normalize-space(ram:TypeCode) = $code][$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-9 -->
|
||||
<assert id="NL-R-001" test="//ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument/ram:IssuerAssignedID" flag="fatal">[NL-R-001] For suppliers in the Netherlands, if the document is a creditnote, the document MUST contain an invoice reference (ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument/ram:IssuerAssignedID)</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-3 -->
|
||||
<assert id="NL-R-002" test="ram:LineOne and ram:CityName and ram:PostcodeCode" flag="fatal">[NL-R-002] For suppliers in the Netherlands the supplier's address (ram:SellerTradeParty/ram:PostalTradeAddress) MUST contain street name (ram:LineOne), city (ram:CityName) and post code (ram:PostcodeCode)</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-1 -->
|
||||
<assert id="NL-R-003" test="(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')" flag="fatal">[NL-R-003] For suppliers in the Netherlands, the legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress[$supplierCountryIsNL and $customerCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-4 -->
|
||||
<assert id="NL-R-004" test="ram:LineOne and ram:CityName and ram:PostcodeCode" flag="fatal">[NL-R-004] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer address (ram:BuyerTradeParty/ram:PostalTradeAddress) MUST contain street name (ram:LineOne), city (ram:CityName) and post code (ram:PostcodeCode)</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID[$supplierCountryIsNL and $customerCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-10 -->
|
||||
<assert id="NL-R-005" test="
|
||||
(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ')
|
||||
or
|
||||
contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')
|
||||
) and (normalize-space(.) != '')
|
||||
" flag="fatal">[NL-R-005] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:PostalTradeAddress[$supplierCountryIsNL and $taxRepresentativeCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-5 -->
|
||||
<assert id="NL-R-006" test="ram:LineOne and ram:CityName and ram:PostcodeCode" flag="fatal">[NL-R-006] For suppliers in the Netherlands, if the fiscal representative is in the Netherlands, the representative's address (ram:SellerTaxRepresentativeTradeParty/ram:PostalTradeAddress) MUST contain street name (ram:LineOne), city (ram:CityName) and post code (ram:PostcodeCode)</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-11 -->
|
||||
<assert id="NL-R-007" test="(normalize-space(/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode/text()) != '381' and
|
||||
xs:decimal(ram:DuePayableAmount) <= 0.0) or
|
||||
(normalize-space(/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:TypeCode/text()) = '381' and
|
||||
xs:decimal(ram:DuePayableAmount) >= 0.0) or
|
||||
(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans)" flag="fatal">[NL-R-007] For suppliers in the Netherlands, the supplier MUST provide a means of payment (ram:SpecifiedTradeSettlementPaymentMeans) if the payment is from customer to supplier</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-12 -->
|
||||
<assert id="NL-R-008" test="normalize-space(ram:TypeCode) = '30' or
|
||||
normalize-space(ram:TypeCode) = '48' or
|
||||
normalize-space(ram:TypeCode) = '49' or
|
||||
normalize-space(ram:TypeCode) = '57' or
|
||||
normalize-space(ram:TypeCode) = '58' or
|
||||
normalize-space(ram:TypeCode) = '59'" flag="fatal">[NL-R-008] For suppliers in the Netherlands, the payment means code (ram:SpecifiedTradeSettlementPaymentMeans/ram:TypeCode) MUST be one of 30, 48, 49, 57, 58 or 59</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeAgreement/ram:BuyerOrderReferencedDocument/ram:LineID[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-13 -->
|
||||
<assert id="NL-R-009" test="exists(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerOrderReferencedDocument/ram:IssuerAssignedID)" flag="fatal">[NL-R-009] For suppliers in the Netherlands, if an order line reference (ram:BuyerOrderReferencedDocument/ram:LineID) is used, there must be an order reference on the document level (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerOrderReferencedDocument/ram:IssuerAssignedID)</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- Restricted code lists and formatting -->
|
||||
<pattern>
|
||||
<let name="ISO3166" value="tokenize('AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW', '\s')"/>
|
||||
<let name="ISO4217" value="tokenize('AFN EUR ALL DZD USD AOA XCD XCD ARS AMD AWG AUD AZN BSD BHD BDT BBD BYN BZD XOF BMD INR BTN BOB BOV USD BAM BWP NOK BRL USD BND BGN XOF BIF CVE KHR XAF CAD KYD XAF XAF CLP CLF CNY AUD AUD COP COU KMF CDF XAF NZD CRC XOF HRK CUP CUC ANG CZK DKK DJF XCD DOP USD EGP SVC USD XAF ERN ETB FKP DKK FJD XPF XAF GMD GEL GHS GIP DKK XCD USD GTQ GBP GNF XOF GYD HTG USD AUD HNL HKD HUF ISK INR IDR XDR IRR IQD GBP ILS JMD JPY GBP JOD KZT KES AUD KPW KRW KWD KGS LAK LBP LSL ZAR LRD LYD CHF MOP MKD MGA MWK MYR MVR XOF USD MRO MUR XUA MXN MXV USD MDL MNT XCD MAD MZN MMK NAD ZAR AUD NPR XPF NZD NIO XOF NGN NZD AUD USD NOK OMR PKR USD PAB USD PGK PYG PEN PHP NZD PLN USD QAR RON RUB RWF SHP XCD XCD XCD WST STD SAR XOF RSD SCR SLL SGD ANG XSU SBD SOS ZAR SSP LKR SDG SRD NOK SZL SEK CHF CHE CHW SYP TWD TJS TZS THB USD XOF NZD TOP TTD TND TRY TMT USD AUD UGX UAH AED GBP USD USD USN UYU UYI UZS VUV VEF VND USD USD XPF MAD YER ZMW ZWL XBA XBB XBC XBD XTS XXX XAU XPD XPT XAG', '\s')"/>
|
||||
<let name="MIMECODE" value="tokenize('application/pdf image/png image/jpeg text/csv application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet', '\s')"/>
|
||||
<let name="UNCL2005" value="tokenize('3 35 432', '\s')"/>
|
||||
<let name="UNCL5189" value="tokenize('41 42 60 62 63 64 65 66 67 68 70 71 88 95 100 102 103 104 105', '\s')"/>
|
||||
<let name="UNCL7161" value="tokenize('AA AAA AAC AAD AAE AAF AAH AAI AAS AAT AAV AAY AAZ ABA ABB ABC ABD ABF ABK ABL ABN ABR ABS ABT ABU ACF ACG ACH ACI ACJ ACK ACL ACM ACS ADC ADE ADJ ADK ADL ADM ADN ADO ADP ADQ ADR ADT ADW ADY ADZ AEA AEB AEC AED AEF AEH AEI AEJ AEK AEL AEM AEN AEO AEP AES AET AEU AEV AEW AEX AEY AEZ AJ AU CA CAB CAD CAE CAF CAI CAJ CAK CAL CAM CAN CAO CAP CAQ CAR CAS CAT CAU CAV CAW CD CG CS CT DAB DAD DL EG EP ER FAA FAB FAC FC FH FI GAA HAA HD HH IAA IAB ID IF IR IS KO L1 LA LAA LAB LF MAE MI ML NAA OA PA PAA PC PL RAB RAC RAD RAF RE RF RH RV SA SAA SAD SAE SAI SG SH SM SU TAB TAC TT TV V1 V2 WH XAA YY ZZZ', '\s')"/>
|
||||
<let name="UNCL5305" value="tokenize('AE E S Z G O K L M', '\s')"/>
|
||||
<let name="eaid" value="tokenize('0002 0007 0009 0037 0060 0088 0096 0097 0106 0130 0135 0142 0147 0151 0170 0183 0184 0188 0190 0191 0192 0193 0195 0196 0198 0199 0200 0201 0202 0204 0208 0209 0210 0211 0212 0213 0215 0216 0218 0221 0230 9901 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 9957', '\s')"/>
|
||||
<rule context="ram:AttachmentBinaryObject[@mimeCode]">
|
||||
<assert id="PEPPOL-EN16931-CL001" test="
|
||||
some $code in $MIMECODE
|
||||
satisfies @mimeCode = $code" flag="fatal">Mime code must be according to subset of IANA code list.</assert>
|
||||
</rule>
|
||||
<rule context="ram:SpecifiedTradeAllowanceCharge[normalize-space(ram:ChargeIndicator/udt:Indicator) = 'false']/ram:ReasonCode">
|
||||
<assert id="PEPPOL-EN16931-CL002" test="
|
||||
some $code in $UNCL5189
|
||||
satisfies normalize-space(text()) = $code" flag="fatal">Reason code MUST be according to subset of UNCL 5189 D.16B.</assert>
|
||||
</rule>
|
||||
<rule context="ram:SpecifiedTradeAllowanceCharge[normalize-space(ram:ChargeIndicator/udt:Indicator) = 'true']/ram:ReasonCode">
|
||||
<assert id="PEPPOL-EN16931-CL003" test="
|
||||
some $code in $UNCL7161
|
||||
satisfies normalize-space(text()) = $code" flag="fatal">Reason code MUST be according to UNCL 7161 D.16B.</assert>
|
||||
</rule>
|
||||
<!-- PEPPOL-EN16931-CL006 is omitted due to lack of description code for invoice period in CII syntax. -->
|
||||
<rule context="ram:TaxTotalAmount[@currencyID]">
|
||||
<assert id="PEPPOL-EN16931-CL007" test="
|
||||
some $code in $ISO4217
|
||||
satisfies @currencyID = $code" flag="fatal">Currency code must be according to ISO 4217:2005</assert>
|
||||
</rule>
|
||||
<rule context="ram:ExchangedDocument/ram:TypeCode">
|
||||
<assert id="PEPPOL-EN16931-P0100" test="
|
||||
$profile != '01' or (some $code in tokenize('71 102 218 219 331 382 553 817 870 875 876 877 380 383 386 388 393 82 80 84 395 575 623 780 381 396 81 83 532', '\s')
|
||||
satisfies normalize-space(text()) = $code)" flag="fatal">Invoice type code MUST be set according to the profile.</assert>
|
||||
</rule>
|
||||
<!-- PEPPOL-EN16931-P0101 is part of PEPPOL-EN16931-P0100. -->
|
||||
<rule context="udt:DateTimeString">
|
||||
<assert id="PEPPOL-EN16931-F001" test="normalize-space(@format) = '102' and string-length(text()) = 8 and matches(normalize-space(text()), '20[0-9]{6}')" flag="fatal">A date MUST be formatted YYYYMMDD.</assert>
|
||||
</rule>
|
||||
<rule context="ram:BuyerTradeParty/ram:URIUniversalCommunication/ram:URIID | ram:SellerTradeParty/ram:URIUniversalCommunication/ram:URIID">
|
||||
<assert id="PEPPOL-EN16931-CL008" test="
|
||||
some $code in $eaid
|
||||
satisfies @schemeID = $code" flag="fatal">Electronic address identifier scheme must be from the codelist "Electronic Address Identifier Scheme"</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
</schema>
|
||||
|
|
@ -0,0 +1,764 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This schematron uses business terms defined the CEN/EN16931-1 and is reproduced with permission from CEN. CEN bears no liability from the use of the content and implementation of this schematron and gives no warranties expressed or implied for any purpose.
|
||||
|
||||
Last update: 2024 May release 3.0.17.
|
||||
-->
|
||||
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:u="utils" schemaVersion="iso" queryBinding="xslt2">
|
||||
<title>Rules for Peppol BIS 3.0 Billing</title>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" prefix="cbc"/>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" prefix="cac"/>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" prefix="ubl-creditnote"/>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" prefix="ubl-invoice"/>
|
||||
<ns uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
|
||||
<ns uri="utils" prefix="u"/>
|
||||
<!-- Parameters -->
|
||||
<let name="profile" value="
|
||||
if (/*/cbc:ProfileID and matches(normalize-space(/*/cbc:ProfileID), 'urn:fdc:peppol.eu:2017:poacc:billing:([0-9]{2}):1.0')) then
|
||||
tokenize(normalize-space(/*/cbc:ProfileID), ':')[7]
|
||||
else
|
||||
'Unknown'"/>
|
||||
<let name="supplierCountry" value="
|
||||
if (/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then
|
||||
upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)))
|
||||
else
|
||||
if (/*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then
|
||||
upper-case(normalize-space(/*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)))
|
||||
else
|
||||
if (/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then
|
||||
upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode))
|
||||
else
|
||||
'XX'"/>
|
||||
<let name="customerCountry" value="
|
||||
if (/*/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then
|
||||
upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)))
|
||||
else
|
||||
if (/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then
|
||||
upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode))
|
||||
else
|
||||
'XX'"/>
|
||||
<!-- -->
|
||||
<let name="documentCurrencyCode" value="/*/cbc:DocumentCurrencyCode"/>
|
||||
<!-- Functions -->
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:gln" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="length" select="string-length($val) - 1"/>
|
||||
<variable name="digits" select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
||||
<variable name="weightedSum" select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (1 + ((($i + 1) mod 2) * 2)))"/>
|
||||
<value-of select="(10 - ($weightedSum mod 10)) mod 10 = number(substring($val, $length + 1, 1))"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:slack" as="xs:boolean">
|
||||
<param name="exp" as="xs:decimal"/>
|
||||
<param name="val" as="xs:decimal"/>
|
||||
<param name="slack" as="xs:decimal"/>
|
||||
<value-of select="xs:decimal($exp + $slack) >= $val and xs:decimal($exp - $slack) <= $val"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:mod11" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="length" select="string-length($val) - 1"/>
|
||||
<variable name="digits" select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
||||
<variable name="weightedSum" select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (($i mod 6) + 2))"/>
|
||||
<value-of select="number($val) > 0 and (11 - ($weightedSum mod 11)) mod 11 = number(substring($val, $length + 1, 1))"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:mod97-0208" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="checkdigits" select="substring($val,9,2)"/>
|
||||
<variable name="calculated_digits" select="xs:string(97 - (xs:integer(substring($val,1,8)) mod 97))"/>
|
||||
<value-of select="number($checkdigits) = number($calculated_digits)"/>
|
||||
</function>
|
||||
<function name="u:checkCodiceIPA" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789</variable>
|
||||
<sequence select="if ( (string-length(translate($arg, $allowed-characters, '')) = 0) and (string-length($arg) = 6) ) then true() else false()"/>
|
||||
</function>
|
||||
<function name="u:checkCF" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<sequence select="
|
||||
if ( (string-length($arg) = 16) or (string-length($arg) = 11) )
|
||||
then
|
||||
(
|
||||
if ((string-length($arg) = 16))
|
||||
then
|
||||
(
|
||||
if (u:checkCF16($arg))
|
||||
then
|
||||
(
|
||||
true()
|
||||
)
|
||||
else
|
||||
(
|
||||
false()
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
if(($arg castable as xs:integer)) then true() else false()
|
||||
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
false()
|
||||
)
|
||||
"/>
|
||||
</function>
|
||||
<function name="u:checkCF16" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</variable>
|
||||
<sequence select="
|
||||
if ( (string-length(translate(substring($arg,1,6), $allowed-characters, '')) = 0) and
|
||||
(substring($arg,7,2) castable as xs:integer) and
|
||||
(string-length(translate(substring($arg,9,1), $allowed-characters, '')) = 0) and
|
||||
(substring($arg,10,2) castable as xs:integer) and
|
||||
(substring($arg,12,3) castable as xs:string) and
|
||||
(substring($arg,15,1) castable as xs:integer) and
|
||||
(string-length(translate(substring($arg,16,1), $allowed-characters, '')) = 0)
|
||||
)
|
||||
then true()
|
||||
else false()
|
||||
"/>
|
||||
</function>
|
||||
<function name="u:checkPIVAseIT" as="xs:boolean" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string"/>
|
||||
<variable name="paese" select="substring($arg,1,2)"/>
|
||||
<variable name="codice" select="substring($arg,3)"/>
|
||||
<sequence select="
|
||||
|
||||
if ( $paese = 'IT' or $paese = 'it' )
|
||||
then
|
||||
(
|
||||
if ( ( string-length($codice) = 11 ) and ( if (u:checkPIVA($codice)!=0) then false() else true() ))
|
||||
then
|
||||
(
|
||||
true()
|
||||
)
|
||||
else
|
||||
(
|
||||
false()
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
true()
|
||||
)
|
||||
|
||||
"/>
|
||||
</function>
|
||||
<function name="u:checkPIVA" as="xs:integer" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<sequence select="
|
||||
if (not($arg castable as xs:integer))
|
||||
then 1
|
||||
else ( u:addPIVA($arg,xs:integer(0)) mod 10 )"/>
|
||||
</function>
|
||||
<function name="u:addPIVA" as="xs:integer" xmlns="http://www.w3.org/1999/XSL/Transform">
|
||||
<param name="arg" as="xs:string"/>
|
||||
<param name="pari" as="xs:integer"/>
|
||||
<variable name="tappo" select="if (not($arg castable as xs:integer)) then 0 else 1"/>
|
||||
<variable name="mapper" select="if ($tappo = 0) then 0 else
|
||||
( if ($pari = 1)
|
||||
then ( xs:integer(substring('0246813579', ( xs:integer(substring($arg,1,1)) +1 ) ,1)) )
|
||||
else ( xs:integer(substring($arg,1,1) ) )
|
||||
)"/>
|
||||
<sequence select="if ($tappo = 0) then $mapper else ( xs:integer($mapper) + u:addPIVA(substring(xs:string($arg),2), (if($pari=0) then 1 else 0) ) )"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:abn" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<value-of select="(
|
||||
((string-to-codepoints(substring($val,1,1)) - 49) * 10) +
|
||||
((string-to-codepoints(substring($val,2,1)) - 48) * 1) +
|
||||
((string-to-codepoints(substring($val,3,1)) - 48) * 3) +
|
||||
((string-to-codepoints(substring($val,4,1)) - 48) * 5) +
|
||||
((string-to-codepoints(substring($val,5,1)) - 48) * 7) +
|
||||
((string-to-codepoints(substring($val,6,1)) - 48) * 9) +
|
||||
((string-to-codepoints(substring($val,7,1)) - 48) * 11) +
|
||||
((string-to-codepoints(substring($val,8,1)) - 48) * 13) +
|
||||
((string-to-codepoints(substring($val,9,1)) - 48) * 15) +
|
||||
((string-to-codepoints(substring($val,10,1)) - 48) * 17) +
|
||||
((string-to-codepoints(substring($val,11,1)) - 48) * 19)) mod 89 = 0
|
||||
"/>
|
||||
</function>
|
||||
|
||||
<!-- Functions and variable for Greek Rules -->
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:TinVerification" as="xs:boolean">
|
||||
<param name="val" as="xs:string"/>
|
||||
<variable name="digits" select="
|
||||
for $ch in string-to-codepoints($val)
|
||||
return codepoints-to-string($ch)"/>
|
||||
<variable name="checksum" select="
|
||||
(number($digits[8])*2) +
|
||||
(number($digits[7])*4) +
|
||||
(number($digits[6])*8) +
|
||||
(number($digits[5])*16) +
|
||||
(number($digits[4])*32) +
|
||||
(number($digits[3])*64) +
|
||||
(number($digits[2])*128) +
|
||||
(number($digits[1])*256) "/>
|
||||
<value-of select="($checksum mod 11) mod 10 = number($digits[9])"/>
|
||||
</function>
|
||||
|
||||
<!-- Function for Swedish organisation numbers (0007) -->
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkSEOrgnr" as="xs:boolean">
|
||||
<param name="number" as="xs:string"/>
|
||||
<choose>
|
||||
<!-- Check if input is numeric -->
|
||||
<when test="not(matches($number, '^\d+$'))">
|
||||
<sequence select="false()"/>
|
||||
</when>
|
||||
<otherwise>
|
||||
<!-- verify the check number of the provided identifier according to the Luhn algorithm-->
|
||||
<variable name="mainPart" select="substring($number, 1, 9)"/>
|
||||
<variable name="checkDigit" select="substring($number, 10, 1)"/>
|
||||
<variable name="sum" as="xs:integer">
|
||||
<value-of select="sum(
|
||||
for $pos in 1 to string-length($mainPart) return
|
||||
if ($pos mod 2 = 1)
|
||||
then (number(substring($mainPart, string-length($mainPart) - $pos + 1, 1)) * 2) mod 10 +
|
||||
(number(substring($mainPart, string-length($mainPart) - $pos + 1, 1)) * 2) idiv 10
|
||||
else number(substring($mainPart, string-length($mainPart) - $pos + 1, 1))
|
||||
)"/>
|
||||
</variable>
|
||||
<variable name="calculatedCheckDigit" select="(10 - $sum mod 10) mod 10"/>
|
||||
<sequence select="$calculatedCheckDigit = number($checkDigit)"/>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</function>
|
||||
<!-- Empty elements -->
|
||||
<pattern>
|
||||
<rule context="//*[not(*) and not(normalize-space())]">
|
||||
<assert id="PEPPOL-EN16931-R008" test="false()" flag="fatal">Document MUST not contain empty elements.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!--
|
||||
Transaction rules
|
||||
|
||||
R00X - Document level
|
||||
R01X - Accounting customer
|
||||
R02X - Accounting supplier
|
||||
R04X - Allowance/Charge (document and line)
|
||||
R05X - Tax
|
||||
R06X - Payment
|
||||
R08X - Additonal document reference
|
||||
R1XX - Line level
|
||||
R11X - Invoice period
|
||||
-->
|
||||
<pattern>
|
||||
<rule context="ubl-creditnote:CreditNote">
|
||||
<assert id="PEPPOL-EN16931-R080" test="(count(cac:AdditionalDocumentReference[cbc:DocumentTypeCode='50']) <= 1)" flag="fatal">Only one project reference is allowed on document level</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<!-- Document level -->
|
||||
<rule context="ubl-creditnote:CreditNote | ubl-invoice:Invoice">
|
||||
<assert id="PEPPOL-EN16931-R001" test="cbc:ProfileID" flag="fatal">Business process MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R007" test="$profile != 'Unknown'" flag="fatal">Business process MUST be in the format 'urn:fdc:peppol.eu:2017:poacc:billing:NN:1.0' where NN indicates the process number.</assert>
|
||||
<assert id="PEPPOL-EN16931-R002" test="count(cbc:Note) <= 1" flag="fatal">No more than one note is allowed on document level.</assert>
|
||||
<assert id="PEPPOL-EN16931-R003" test="cbc:BuyerReference or cac:OrderReference/cbc:ID" flag="fatal">A buyer reference or purchase order reference MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R004" test="starts-with(normalize-space(cbc:CustomizationID/text()), 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0')" flag="fatal">Specification identifier MUST have the value 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'.</assert>
|
||||
<assert id="PEPPOL-EN16931-R053" test="count(cac:TaxTotal[cac:TaxSubtotal]) = 1" flag="fatal">Only one tax total with tax subtotals MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R054" test="count(cac:TaxTotal[not(cac:TaxSubtotal)]) = (if (cbc:TaxCurrencyCode) then 1 else 0)" flag="fatal">Only one tax total without tax subtotals MUST be provided when tax currency code is provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R055" test="not(cbc:TaxCurrencyCode) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] <= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] <= 0) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] >= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] >= 0) " flag="fatal">Invoice total VAT amount and Invoice total VAT amount in accounting currency MUST have the same operational sign</assert>
|
||||
</rule>
|
||||
<rule context="cbc:TaxCurrencyCode">
|
||||
<assert id="PEPPOL-EN16931-R005" test="not(normalize-space(text()) = normalize-space(../cbc:DocumentCurrencyCode/text()))" flag="fatal">VAT accounting currency code MUST be different from invoice currency code when provided.</assert>
|
||||
</rule>
|
||||
<!-- Accounting customer -->
|
||||
<rule context="cac:AccountingCustomerParty/cac:Party">
|
||||
<assert id="PEPPOL-EN16931-R010" test="cbc:EndpointID" flag="fatal">Buyer electronic address MUST be provided</assert>
|
||||
</rule>
|
||||
<!-- Accounting supplier -->
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party">
|
||||
<assert id="PEPPOL-EN16931-R020" test="cbc:EndpointID" flag="fatal">Seller electronic address MUST be provided</assert>
|
||||
</rule>
|
||||
<!-- Allowance/Charge (document level/line level) -->
|
||||
<rule context="ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]">
|
||||
<assert id="PEPPOL-EN16931-R041" test="false()" flag="fatal">Allowance/charge base amount MUST be provided when allowance/charge percentage is provided.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount]">
|
||||
<assert id="PEPPOL-EN16931-R042" test="false()" flag="fatal">Allowance/charge percentage MUST be provided when allowance/charge base amount is provided.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice/cac:AllowanceCharge | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge">
|
||||
<assert id="PEPPOL-EN16931-R040" test="
|
||||
not(cbc:MultiplierFactorNumeric and cbc:BaseAmount) or u:slack(if (cbc:Amount) then
|
||||
cbc:Amount
|
||||
else
|
||||
0, (xs:decimal(cbc:BaseAmount) * xs:decimal(cbc:MultiplierFactorNumeric)) div 100, 0.02)" flag="fatal">Allowance/charge amount must equal base amount * percentage/100 if base amount and percentage exists</assert>
|
||||
<assert id="PEPPOL-EN16931-R043" test="normalize-space(cbc:ChargeIndicator/text()) = 'true' or normalize-space(cbc:ChargeIndicator/text()) = 'false'" flag="fatal">Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'</assert>
|
||||
</rule>
|
||||
<!-- Payment -->
|
||||
<rule context="
|
||||
cac:PaymentMeans[some $code in tokenize('49 59', '\s')
|
||||
satisfies normalize-space(cbc:PaymentMeansCode) = $code]">
|
||||
<assert id="PEPPOL-EN16931-R061" test="cac:PaymentMandate/cbc:ID" flag="fatal">Mandate reference MUST be provided for direct debit.</assert>
|
||||
</rule>
|
||||
<!-- Currency -->
|
||||
<rule context="cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount">
|
||||
<assert id="PEPPOL-EN16931-R051" test="@currencyID = $documentCurrencyCode" flag="fatal">All currencyID attributes must have the same value as the invoice currency code (BT-5), except for the invoice total VAT amount in accounting currency (BT-111).</assert>
|
||||
</rule>
|
||||
<!-- Line level - invoice period -->
|
||||
<rule context="ubl-invoice:Invoice[cac:InvoicePeriod/cbc:StartDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:StartDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:StartDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:StartDate">
|
||||
<assert id="PEPPOL-EN16931-R110" test="xs:date(text()) >= xs:date(../../../cac:InvoicePeriod/cbc:StartDate)" flag="fatal">Start date of line period MUST be within invoice period.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice[cac:InvoicePeriod/cbc:EndDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:EndDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:EndDate">
|
||||
<assert id="PEPPOL-EN16931-R111" test="xs:date(text()) <= xs:date(../../../cac:InvoicePeriod/cbc:EndDate)" flag="fatal">End date of line period MUST be within invoice period.</assert>
|
||||
</rule>
|
||||
<!-- Line level - line extension amount -->
|
||||
<rule context="cac:InvoiceLine | cac:CreditNoteLine">
|
||||
<let name="lineExtensionAmount" value="
|
||||
if (cbc:LineExtensionAmount) then
|
||||
xs:decimal(cbc:LineExtensionAmount)
|
||||
else
|
||||
0"/>
|
||||
<let name="quantity" value="
|
||||
if (/ubl-invoice:Invoice) then
|
||||
(if (cbc:InvoicedQuantity) then
|
||||
xs:decimal(cbc:InvoicedQuantity)
|
||||
else
|
||||
1)
|
||||
else
|
||||
(if (cbc:CreditedQuantity) then
|
||||
xs:decimal(cbc:CreditedQuantity)
|
||||
else
|
||||
1)"/>
|
||||
<let name="priceAmount" value="
|
||||
if (cac:Price/cbc:PriceAmount) then
|
||||
xs:decimal(cac:Price/cbc:PriceAmount)
|
||||
else
|
||||
0"/>
|
||||
<let name="baseQuantity" value="
|
||||
if (cac:Price/cbc:BaseQuantity and xs:decimal(cac:Price/cbc:BaseQuantity) != 0) then
|
||||
xs:decimal(cac:Price/cbc:BaseQuantity)
|
||||
else
|
||||
1"/>
|
||||
<let name="allowancesTotal" value="
|
||||
if (cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'false']) then
|
||||
round(sum(cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'false']/cbc:Amount/xs:decimal(.)) * 10 * 10) div 100
|
||||
else
|
||||
0"/>
|
||||
<let name="chargesTotal" value="
|
||||
if (cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'true']) then
|
||||
round(sum(cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'true']/cbc:Amount/xs:decimal(.)) * 10 * 10) div 100
|
||||
else
|
||||
0"/>
|
||||
<assert id="PEPPOL-EN16931-R120" test="u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, 0.02)" flag="fatal">Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount</assert>
|
||||
<assert id="PEPPOL-EN16931-R121" test="not(cac:Price/cbc:BaseQuantity) or xs:decimal(cac:Price/cbc:BaseQuantity) > 0" flag="fatal">Base quantity MUST be a positive number above zero.</assert>
|
||||
<assert id="PEPPOL-EN16931-R100" test="(count(cac:DocumentReference) <= 1)" flag="fatal">Only one invoiced object is allowed pr line</assert>
|
||||
<assert id="PEPPOL-EN16931-R101" test="(not(cac:DocumentReference) or (cac:DocumentReference/cbc:DocumentTypeCode='130'))" flag="fatal">Element Document reference can only be used for Invoice line object</assert>
|
||||
</rule>
|
||||
<!-- Allowance (price level) -->
|
||||
<rule context="cac:Price/cac:AllowanceCharge">
|
||||
<assert id="PEPPOL-EN16931-R044" test="normalize-space(cbc:ChargeIndicator) = 'false'" flag="fatal">Charge on price level is NOT allowed. Only value 'false' allowed.</assert>
|
||||
<assert id="PEPPOL-EN16931-R046" test="not(cbc:BaseAmount) or xs:decimal(../cbc:PriceAmount) = xs:decimal(cbc:BaseAmount) - xs:decimal(cbc:Amount)" flag="fatal">Item net price MUST equal (Gross price - Allowance amount) when gross price is provided.</assert>
|
||||
</rule>
|
||||
<!-- Price -->
|
||||
<rule context="cac:Price/cbc:BaseQuantity[@unitCode]">
|
||||
<let name="hasQuantity" value="../../cbc:InvoicedQuantity or ../../cbc:CreditedQuantity"/>
|
||||
<let name="quantity" value="
|
||||
if (/ubl-invoice:Invoice) then
|
||||
../../cbc:InvoicedQuantity
|
||||
else
|
||||
../../cbc:CreditedQuantity"/>
|
||||
<assert id="PEPPOL-EN16931-R130" test="not($hasQuantity) or @unitCode = $quantity/@unitCode" flag="fatal">Unit code of price base quantity MUST be same as invoiced quantity.</assert>
|
||||
</rule>
|
||||
<!-- Validation of ICD -->
|
||||
<rule context="cbc:EndpointID[@schemeID = '0088'] | cac:PartyIdentification/cbc:ID[@schemeID = '0088'] | cbc:CompanyID[@schemeID = '0088']">
|
||||
<assert id="PEPPOL-COMMON-R040" test="matches(normalize-space(), '^[0-9]+$') and u:gln(normalize-space())" flag="fatal">GLN must have a valid format according to GS1 rules.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0192'] | cac:PartyIdentification/cbc:ID[@schemeID = '0192'] | cbc:CompanyID[@schemeID = '0192']">
|
||||
<assert id="PEPPOL-COMMON-R041" test="matches(normalize-space(), '^[0-9]{9}$') and u:mod11(normalize-space())" flag="fatal">Norwegian organization number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0184'] | cac:PartyIdentification/cbc:ID[@schemeID = '0184'] | cbc:CompanyID[@schemeID = '0184']">
|
||||
<assert id="PEPPOL-COMMON-R042" test="(string-length(text()) = 10) and (substring(text(), 1, 2) = 'DK') and (string-length(translate(substring(text(), 3, 8), '1234567890', '')) = 0)" flag="fatal">Danish organization number (CVR) MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0208'] | cac:PartyIdentification/cbc:ID[@schemeID = '0208'] | cbc:CompanyID[@schemeID = '0208']">
|
||||
<assert id="PEPPOL-COMMON-R043" test="matches(normalize-space(), '^[0-9]{10}$') and u:mod97-0208(normalize-space())" flag="fatal">Belgian enterprise number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0201'] | cac:PartyIdentification/cbc:ID[@schemeID = '0201'] | cbc:CompanyID[@schemeID = '0201']">
|
||||
<assert id="PEPPOL-COMMON-R044" test="u:checkCodiceIPA(normalize-space())" flag="warning">IPA Code (Codice Univoco Unità Organizzativa) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0210'] | cac:PartyIdentification/cbc:ID[@schemeID = '0210'] | cbc:CompanyID[@schemeID = '0210']">
|
||||
<assert id="PEPPOL-COMMON-R045" test="u:checkCF(normalize-space())" flag="warning">Tax Code (Codice Fiscale) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '9907']">
|
||||
<assert id="PEPPOL-COMMON-R046" test="u:checkCF(normalize-space())" flag="warning">Tax Code (Codice Fiscale) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0211'] | cac:PartyIdentification/cbc:ID[@schemeID = '0211'] | cbc:CompanyID[@schemeID = '0211']">
|
||||
<assert id="PEPPOL-COMMON-R047" test="u:checkPIVAseIT(normalize-space())" flag="warning">Italian VAT Code (Partita Iva) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<!-- <rule context="cbc:EndpointID[@schemeID = '9906']">
|
||||
<assert id="PEPPOL-COMMON-R048" test="u:checkPIVAseIT(normalize-space())" flag="warning">Italian VAT Code (Partita Iva) must be stated in the correct format</assert>
|
||||
</rule> -->
|
||||
<rule context="cbc:EndpointID[@schemeID = '0007'] | cac:PartyIdentification/cbc:ID[@schemeID = '0007'] | cbc:CompanyID[@schemeID = '0007']">
|
||||
<assert id="PEPPOL-COMMON-R049" test="string-length(normalize-space()) = 10 and string(number(normalize-space())) != 'NaN' and u:checkSEOrgnr(normalize-space())" flag="fatal">Swedish organization number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0151'] | cac:PartyIdentification/cbc:ID[@schemeID = '0151'] | cbc:CompanyID[@schemeID = '0151']">
|
||||
<assert id="PEPPOL-COMMON-R050" test="matches(normalize-space(), '^[0-9]{11}$') and u:abn(normalize-space())" flag="fatal">Australian Business Number (ABN) MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- National rules -->
|
||||
<pattern>
|
||||
<!-- NORWAY -->
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'NO']">
|
||||
<assert id="NO-R-002" test="normalize-space(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'TAX']/cbc:CompanyID) = 'Foretaksregisteret'" flag="warning">For Norwegian suppliers, most invoice issuers are required to append "Foretaksregisteret" to their
|
||||
invoice. "Dersom selger er aksjeselskap, allmennaksjeselskap eller filial av utenlandsk
|
||||
selskap skal også ordet «Foretaksregisteret» fremgå av salgsdokumentet, jf.
|
||||
foretaksregisterloven § 10-2."</assert>
|
||||
<assert id="NO-R-001" test="cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO' and matches(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID,3), '^[0-9]{9}MVA$')
|
||||
and u:mod11(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID, 3, 9)) or not(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO')" flag="fatal">For Norwegian suppliers, a VAT number MUST be the country code prefix NO followed by a valid Norwegian organization number (nine numbers) followed by the letters MVA.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- DENMARK -->
|
||||
<pattern>
|
||||
<let name="DKSupplierCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
<let name="DKCustomerCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
<!-- Document level -->
|
||||
<rule context="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']">
|
||||
<assert id="DK-R-002" test="(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/text()) != '')" flag="fatal">Danish suppliers MUST provide legal entity (CVR-number)</assert>
|
||||
<assert id="DK-R-014" test="not(((boolean(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID))
|
||||
and (normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID) != '0184'))
|
||||
)" flag="fatal">For Danish Suppliers it is mandatory to specify schemeID as "0184" (DK CVR-number) when PartyLegalEntity/CompanyID is used for AccountingSupplierParty</assert>
|
||||
<assert id="DK-R-016" test="not((boolean(/ubl-creditnote:CreditNote) and ($DKCustomerCountry = 'DK'))
|
||||
and (number(cac:LegalMonetaryTotal/cbc:PayableAmount/text()) < 0)
|
||||
)" flag="fatal">For Danish Suppliers, a Credit note cannot have a negative total (PayableAmount)</assert>
|
||||
</rule>
|
||||
<rule context="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification">
|
||||
<assert id="DK-R-013" test="not((boolean(cbc:ID))
|
||||
and (normalize-space(cbc:ID/@schemeID) = '')
|
||||
)" flag="fatal">For Danish Suppliers it is mandatory to use schemeID when PartyIdentification/ID is used for AccountingCustomerParty or AccountingSupplierParty</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:PaymentMeans">
|
||||
<assert id="DK-R-005" test="contains(' 1 10 31 42 48 49 50 58 59 93 97 ', concat(' ', cbc:PaymentMeansCode, ' '))" flag="fatal">For Danish suppliers the following Payment means codes are allowed: 1, 10, 31, 42, 48, 49, 50, 58, 59, 93 and 97</assert>
|
||||
<assert id="DK-R-006" test="not(((cbc:PaymentMeansCode = '31') or (cbc:PaymentMeansCode = '42'))
|
||||
and not((normalize-space(cac:PayeeFinancialAccount/cbc:ID/text()) != '') and (normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID/text()) != ''))
|
||||
)" flag="fatal">For Danish suppliers bank account and registration account is mandatory if payment means is 31 or 42</assert>
|
||||
<assert id="DK-R-007" test="not((cbc:PaymentMeansCode = '49')
|
||||
and not((normalize-space(cac:PaymentMandate/cbc:ID/text()) != '')
|
||||
and (normalize-space(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID/text()) != ''))
|
||||
)" flag="fatal">For Danish suppliers PaymentMandate/ID and PayerFinancialAccount/ID are mandatory when payment means is 49</assert>
|
||||
<assert id="DK-R-008" test="not((cbc:PaymentMeansCode = '50')
|
||||
and not(((substring(cbc:PaymentID, 1, 3) = '01#')
|
||||
or (substring(cbc:PaymentID, 1, 3) = '04#')
|
||||
or (substring(cbc:PaymentID, 1, 3) = '15#'))
|
||||
and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 7)
|
||||
)
|
||||
)" flag="fatal">For Danish Suppliers PaymentID is mandatory and MUST start with 01#, 04# or 15# (kortartkode), and PayeeFinancialAccount/ID (Giro kontonummer) is mandatory and must be 7 characters long, when payment means equals 50 (Giro)</assert>
|
||||
<assert id="DK-R-009" test="not((cbc:PaymentMeansCode = '50')
|
||||
and ((substring(cbc:PaymentID, 1, 3) = '04#')
|
||||
or (substring(cbc:PaymentID, 1, 3) = '15#'))
|
||||
and not(string-length(cbc:PaymentID) = 19)
|
||||
)" flag="fatal">For Danish Suppliers if the PaymentID is prefixed with 04# or 15# the 16 digits instruction Id must be added to the PaymentID eg. "04#1234567890123456" when Payment means equals 50 (Giro)</assert>
|
||||
<assert id="DK-R-010" test="not((cbc:PaymentMeansCode = '93')
|
||||
and not(((substring(cbc:PaymentID, 1, 3) = '71#')
|
||||
or (substring(cbc:PaymentID, 1, 3) = '73#')
|
||||
or (substring(cbc:PaymentID, 1, 3) = '75#'))
|
||||
and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 8)
|
||||
)
|
||||
)" flag="fatal">For Danish Suppliers the PaymentID is mandatory and MUST start with 71#, 73# or 75# (kortartkode) and PayeeFinancialAccount/ID (Kreditornummer) is mandatory and must be exactly 8 characters long, when Payment means equals 93 (FIK)</assert>
|
||||
<assert id="DK-R-011" test="not((cbc:PaymentMeansCode = '93')
|
||||
and ((substring(cbc:PaymentID, 1, 3) = '71#')
|
||||
or (substring(cbc:PaymentID, 1, 3) = '75#'))
|
||||
and not((string-length(cbc:PaymentID) = 18)
|
||||
or (string-length(cbc:PaymentID) = 19))
|
||||
)" flag="fatal">For Danish Suppliers if the PaymentID is prefixed with 71# or 75# the 15-16 digits instruction Id must be added to the PaymentID eg. "71#1234567890123456" when payment Method equals 93 (FIK)</assert>
|
||||
</rule>
|
||||
<!-- Line level -->
|
||||
<rule context="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:CreditNoteLine | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:InvoiceLine">
|
||||
<assert id="DK-R-003" test="not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listID = 'TST')
|
||||
and not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.05.01')
|
||||
or (cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.0501')
|
||||
)
|
||||
)" flag="warning">If ItemClassification is provided from Danish suppliers, UNSPSC version 19.0501 should be used.</assert>
|
||||
</rule>
|
||||
<!-- Mix level -->
|
||||
<rule context="cac:AllowanceCharge[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']">
|
||||
<assert id="DK-R-004" test="not((cbc:AllowanceChargeReasonCode = 'ZZZ')
|
||||
and not((string-length(normalize-space(cbc:AllowanceChargeReason/text())) = 4)
|
||||
and (number(cbc:AllowanceChargeReason) >= 0)
|
||||
and (number(cbc:AllowanceChargeReason) <= 9999))
|
||||
)" flag="fatal">When specifying non-VAT Taxes for Danish customers, Danish suppliers MUST use the AllowanceChargeReasonCode="ZZZ" and the 4-digit Tax category MUST be specified in AllowanceChargeReason</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- ITALY -->
|
||||
<pattern>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) != 'VAT']">
|
||||
<assert id="IT-R-001" test="matches(normalize-space(cbc:CompanyID),'^[A-Z0-9]{11,16}$')" flag="fatal">[IT-R-001] BT-32 (Seller tax registration identifier) - For Italian suppliers BT-32 minimum length 11 and maximum length shall be 16. Per i fornitori italiani il BT-32 deve avere una lunghezza tra 11 e 16 caratteri</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']">
|
||||
<assert id="IT-R-002" test="cac:PostalAddress/cbc:StreetName" flag="fatal">[IT-R-002] BT-35 (Seller address line 1) - Italian suppliers MUST provide the postal address line 1 - I fornitori italiani devono indicare l'indirizzo postale.</assert>
|
||||
<assert id="IT-R-003" test="cac:PostalAddress/cbc:CityName" flag="fatal">[IT-R-003] BT-37 (Seller city) - Italian suppliers MUST provide the postal address city - I fornitori italiani devono indicare la città di residenza.</assert>
|
||||
<assert id="IT-R-004" test="cac:PostalAddress/cbc:PostalZone" flag="fatal">">[IT-R-004] BT-38 (Seller post code) - Italian suppliers MUST provide the postal address post code - I fornitori italiani devono indicare il CAP di residenza.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- SWEDEN -->
|
||||
<pattern>
|
||||
<rule context="//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE']">
|
||||
<assert id="SE-R-001" test="string-length(normalize-space(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID)) = 14" flag="fatal">For Swedish suppliers, Swedish VAT-numbers must consist of 14 characters.</assert>
|
||||
<assert id="SE-R-002" test="string(number(substring(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID, 3, 12))) != 'NaN'" flag="fatal">For Swedish suppliers, the Swedish VAT-numbers must have the trailing 12 characters in numeric form</assert>
|
||||
</rule>
|
||||
<rule context="//cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity[../cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cbc:CompanyID]">
|
||||
<assert id="SE-R-003" test="string(number(cbc:CompanyID)) != 'NaN'" flag="warning">Swedish organisation numbers should be numeric.</assert>
|
||||
<assert id="SE-R-004" test="string-length(normalize-space(cbc:CompanyID)) = 10" flag="warning">Swedish organisation numbers consist of 10 characters.</assert>
|
||||
<assert id="SE-R-013" test="u:checkSEOrgnr(normalize-space(cbc:CompanyID))" flag="warning">The last digit of a Swedish organization number must be valid according to the Luhn algorithm.</assert>
|
||||
</rule>
|
||||
<rule context="//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and exists(cac:PartyLegalEntity/cbc:CompanyID)]/cac:PartyTaxScheme[normalize-space(upper-case(cac:TaxScheme/cbc:ID)) != 'VAT']/cbc:CompanyID">
|
||||
<assert id="SE-R-005" test="normalize-space(upper-case(.)) = 'GODKÄND FÖR F-SKATT'" flag="fatal">For Swedish suppliers, when using Seller tax registration identifier, 'Godkänd för F-skatt' must be stated</assert>
|
||||
</rule>
|
||||
<rule context="//cac:TaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S'] | //cac:ClassifiedTaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S']">
|
||||
<assert id="SE-R-006" test="number(cbc:Percent) = 25 or number(cbc:Percent) = 12 or number(cbc:Percent) = 6" flag="fatal">For Swedish suppliers, only standard VAT rate of 6, 12 or 25 are used</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:PLUSGIRO']/cac:PayeeFinancialAccount/cbc:ID">
|
||||
<assert id="SE-R-007" test="string(number(normalize-space(.))) != 'NaN'" flag="warning">For Swedish suppliers using Plusgiro, the Account ID must be numeric </assert>
|
||||
<assert id="SE-R-010" test="string-length(normalize-space(.)) >= 2 and string-length(normalize-space(.)) <= 8" flag="warning">For Swedish suppliers using Plusgiro, the Account ID must have 2-8 characters</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:BANKGIRO']/cac:PayeeFinancialAccount/cbc:ID">
|
||||
<assert id="SE-R-008" test="string(number(normalize-space(.))) != 'NaN'" flag="warning">For Swedish suppliers using Bankgiro, the Account ID must be numeric </assert>
|
||||
<assert id="SE-R-009" test="string-length(normalize-space(.)) = 7 or string-length(normalize-space(.)) = 8" flag="warning">For Swedish suppliers using Bankgiro, the Account ID must have 7-8 characters</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('50') or cbc:PaymentMeansCode = normalize-space('56'))]">
|
||||
<assert id="SE-R-011" test="false()" flag="warning">For Swedish suppliers using Swedish Bankgiro or Plusgiro, the proper way to indicate this is to use Code 30 for PaymentMeans and FinancialInstitutionBranch ID with code SE:BANKGIRO or SE:PLUSGIRO</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and //cac:AccountingCustomerParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('31'))]">
|
||||
<assert id="SE-R-012" test="false()" flag="warning">For domestic transactions between Swedish trading partners, credit transfer should be indicated by PaymentMeansCode="30"</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- GREECE -->
|
||||
<!-- General variable for Greek Rules -->
|
||||
<let name="isGreekSender" value="($supplierCountry ='GR') or ($supplierCountry ='EL')"/>
|
||||
<let name="isGreekReceiver" value="($customerCountry ='GR') or ($customerCountry ='EL')"/>
|
||||
<let name="isGreekSenderandReceiver" value="$isGreekSender and $isGreekReceiver"/>
|
||||
<!-- Test only accounting Supplier Country -->
|
||||
<let name="accountingSupplierCountry" value="
|
||||
if (/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then
|
||||
upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)))
|
||||
else
|
||||
if (/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then
|
||||
upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode))
|
||||
else
|
||||
'XX'"/>
|
||||
<!-- Sender Rules -->
|
||||
<pattern>
|
||||
<let name="dateRegExp" value="'^(0?[1-9]|[12][0-9]|3[01])[-\\/ ]?(0?[1-9]|1[0-2])[-\\/ ]?(19|20)[0-9]{2}'"/>
|
||||
<let name="greekDocumentType" value="tokenize('1.1 1.6 2.1 2.4 5.1 5.2 ','\s')"/>
|
||||
<let name="tokenizedUblIssueDate" value="tokenize(/*/cbc:IssueDate,'-')"/>
|
||||
<!-- Invoice ID -->
|
||||
<rule context="/ubl-invoice:Invoice/cbc:ID[$isGreekSender] | /ubl-creditnote:CreditNote/cbc:ID[$isGreekSender]">
|
||||
<let name="IdSegments" value="tokenize(.,'\|')"/>
|
||||
<assert id="GR-R-001-1" test="count($IdSegments) = 6" flag="fatal"> When the Supplier is Greek, the Invoice Id should consist of 6 segments</assert>
|
||||
<assert id="GR-R-001-2" test="string-length(normalize-space($IdSegments[1])) = 9
|
||||
and u:TinVerification($IdSegments[1])
|
||||
and ($IdSegments[1] = /*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9)
|
||||
or $IdSegments[1] = /*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) )" flag="fatal">When the Supplier is Greek, the Invoice Id first segment must be a valid TIN Number and match either the Supplier's or the Tax Representative's Tin Number</assert>
|
||||
<let name="tokenizedIdDate" value="tokenize($IdSegments[2],'/')"/>
|
||||
<assert id="GR-R-001-3" test="string-length(normalize-space($IdSegments[2]))>0
|
||||
and matches($IdSegments[2],$dateRegExp)
|
||||
and ($tokenizedIdDate[1] = $tokenizedUblIssueDate[3]
|
||||
and $tokenizedIdDate[2] = $tokenizedUblIssueDate[2]
|
||||
and $tokenizedIdDate[3] = $tokenizedUblIssueDate[1])" flag="fatal">When the Supplier is Greek, the Invoice Id second segment must be a valid Date that matches the invoice Issue Date</assert>
|
||||
<assert id="GR-R-001-4" test="string-length(normalize-space($IdSegments[3]))>0 and string(number($IdSegments[3])) != 'NaN' and xs:integer($IdSegments[3]) >= 0" flag="fatal">When Supplier is Greek, the Invoice Id third segment must be a positive integer</assert>
|
||||
<assert id="GR-R-001-5" test="string-length(normalize-space($IdSegments[4]))>0 and (some $c in $greekDocumentType satisfies $IdSegments[4] = $c)" flag="fatal">When Supplier is Greek, the Invoice Id in the fourth segment must be a valid greek document type</assert>
|
||||
<assert id="GR-R-001-6" test="string-length($IdSegments[5]) > 0 " flag="fatal">When Supplier is Greek, the Invoice Id fifth segment must not be empty</assert>
|
||||
<assert id="GR-R-001-7" test="string-length($IdSegments[6]) > 0 " flag="fatal">When Supplier is Greek, the Invoice Id sixth segment must not be empty</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty[$isGreekSender]/cac:Party">
|
||||
<!-- Supplier Name Mandatory -->
|
||||
<assert id="GR-R-002" test="string-length(./cac:PartyName/cbc:Name)>0" flag="fatal">Greek Suppliers must provide their full name as they are registered in the Greek Business Registry (G.E.MH.) as a legal entity or in the Tax Registry as a natural person </assert>
|
||||
<!-- Supplier VAT Mandatory -->
|
||||
<assert id="GR-S-011" test="count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and
|
||||
substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and
|
||||
u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))" flag="warning">Greek suppliers must provide their Seller Tax Registration Number, prefixed by the country code</assert>
|
||||
</rule>
|
||||
<!-- VAT Number Rules -->
|
||||
<rule context="cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID">
|
||||
<assert id="GR-R-003" test="substring(.,1,2) = 'EL' and u:TinVerification(substring(.,3))" flag="fatal">For the Greek Suppliers, the VAT must start with 'EL' and must be a valid TIN number</assert>
|
||||
</rule>
|
||||
<!-- Document Reference Rules (existence of MARK and Invoice Verification URL) -->
|
||||
<rule context="/ubl-invoice:Invoice[$isGreekSender and ( /*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'GR')] | /ubl-creditnote:CreditNote[$isGreekSender and ( /*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'GR')]">
|
||||
<!-- ΜARK Rules -->
|
||||
<assert id="GR-R-004-1" test="count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##M.AR.K##'])=1" flag="fatal"> When Supplier is Greek, there must be one MARK Number</assert>
|
||||
<assert id="GR-S-008-1" flag="warning" test="count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##'])=1"> When Supplier is Greek, there should be one invoice url</assert>
|
||||
<assert id="GR-R-008-2" test="(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 0 ) or (count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 1 )" flag="fatal"> When Supplier is Greek, there should be no more than one invoice url</assert>
|
||||
</rule>
|
||||
<!-- MARK Rules -->
|
||||
<rule context="cac:AdditionalDocumentReference[$isGreekSender and ( /*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'GR') and cbc:DocumentDescription = '##M.AR.K##']/cbc:ID">
|
||||
<assert id="GR-R-004-2" test="matches(.,'^[1-9]([0-9]*)')" flag="fatal"> When Supplier is Greek, the MARK Number must be a positive integer</assert>
|
||||
</rule>
|
||||
|
||||
<!-- Invoice Verification URL Rules -->
|
||||
<rule context="cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##INVOICE|URL##']">
|
||||
<assert id="GR-R-008-3" test="string-length(normalize-space(cac:Attachment/cac:ExternalReference/cbc:URI))>0" flag="fatal">When Supplier is Greek and the INVOICE URL Document reference exists, the External Reference URI should be present</assert>
|
||||
</rule>
|
||||
<!-- Customer Name Mandatory -->
|
||||
<rule context="cac:AccountingCustomerParty[$isGreekSender]/cac:Party">
|
||||
<assert id="GR-R-005" test="string-length(./cac:PartyName/cbc:Name)>0" flag="fatal">Greek Suppliers must provide the full name of the buyer</assert>
|
||||
</rule>
|
||||
<!-- Endpoint Rules -->
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$accountingSupplierCountry='GR' or $accountingSupplierCountry='EL']/cbc:EndpointID">
|
||||
<assert id="GR-R-009" test="./@schemeID='9933' and u:TinVerification(.)" flag="fatal">Greek suppliers that send an invoice through the PEPPOL network must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (schemeID 9933).</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- Greek Sender and Greek Receiver rules -->
|
||||
<pattern>
|
||||
<!-- VAT Number Rules -->
|
||||
<rule context="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party">
|
||||
<assert id="GR-R-006" test="count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and
|
||||
substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and
|
||||
u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))" flag="fatal">Greek Suppliers must provide the VAT number of the buyer, if the buyer is Greek </assert>
|
||||
</rule>
|
||||
<!-- Endpoint Rules -->
|
||||
<rule context="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party/cbc:EndpointID">
|
||||
<assert id="GR-R-010" test="./@schemeID='9933' and u:TinVerification(.)" flag="fatal">Greek Suppliers that send an invoice through the PEPPOL network to a greek buyer must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (SchemeID 9933)</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- ICELAND -->
|
||||
<pattern>
|
||||
<let name="SupplierCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
<let name="CustomerCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
<rule context="ubl-creditnote:CreditNote[$SupplierCountry = 'IS'] | ubl-invoice:Invoice[$SupplierCountry = 'IS']">
|
||||
<assert id="IS-R-001" test="( ( not(contains(normalize-space(cbc:InvoiceTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:InvoiceTypeCode),' ') ) ) ) or ( ( not(contains(normalize-space(cbc:CreditNoteTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:CreditNoteTypeCode),' ') ) ) )" flag="warning">[IS-R-001]-If seller is icelandic then invoice type should be 380 or 381 — Ef seljandi er íslenskur þá ætti gerð reiknings (BT-3) að vera sölureikningur (380) eða kreditreikningur (381).</assert>
|
||||
<assert id="IS-R-002" test="exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'" flag="fatal">[IS-R-002]-If seller is icelandic then it shall contain sellers legal id — Ef seljandi er íslenskur þá skal reikningur innihalda íslenska kennitölu seljanda (BT-30).</assert>
|
||||
<assert id="IS-R-003" test="exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone)" flag="fatal">[IS-R-003]-If seller is icelandic then it shall contain his address with street name and zip code — Ef seljandi er íslenskur þá skal heimilisfang seljanda innihalda götuheiti og póstnúmer (BT-35 og BT-38).</assert>
|
||||
<assert id="IS-R-006" test="exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID)
|
||||
and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID)) = 12
|
||||
or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']))" flag="fatal">[IS-R-006]-If seller is icelandic and payment means code is 9 then a 12 digit account id must exist — Ef seljandi er íslenskur og greiðslumáti (BT-81) er krafa (kóti 9) þá skal koma fram 12 stafa númer (bankanúmer, höfuðbók 66 og reikningsnúmer) (BT-84)</assert>
|
||||
<assert id="IS-R-007" test="exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID)
|
||||
and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID)) = 12
|
||||
or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']))" flag="fatal">[IS-R-007]-If seller is icelandic and payment means code is 42 then a 12 digit account id must exist — Ef seljandi er íslenskur og greiðslumáti (BT-81) er millifærsla (kóti 42) þá skal koma fram 12 stafa reikningnúmer (BT-84)</assert>
|
||||
<assert id="IS-R-008" test="(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and string-length(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) = 10 and (string(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) castable as xs:date)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))" flag="fatal">[IS-R-008]-If seller is icelandic and invoice contains supporting description EINDAGI then the id form must be YYYY-MM-DD — Ef seljandi er íslenskur þá skal eindagi (BT-122, DocumentDescription = EINDAGI) vera á forminu YYYY-MM-DD.</assert>
|
||||
<assert id="IS-R-009" test="(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and exists(cbc:DueDate)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))" flag="fatal">[IS-R-009]-If seller is icelandic and invoice contains supporting description EINDAGI invoice must have due date — Ef seljandi er íslenskur þá skal reikningur sem inniheldur eindaga (BT-122, DocumentDescription = EINDAGI) einnig hafa gjalddaga (BT-9).</assert>
|
||||
<assert id="IS-R-010" test="(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and (cbc:DueDate) <= (cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))" flag="fatal">[IS-R-010]-If seller is icelandic and invoice contains supporting description EINDAGI the id date must be same or later than due date — Ef seljandi er íslenskur þá skal eindagi (BT-122, DocumentDescription = EINDAGI) skal vera sami eða síðar en gjalddagi (BT-9) ef eindagi er til staðar.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-creditnote:CreditNote[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty | ubl-invoice:Invoice[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty">
|
||||
<assert id="IS-R-004" test="exists(cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'" flag="fatal">[IS-R-004]-If seller and buyer are icelandic then the invoice shall contain the buyers icelandic legal identifier — Ef seljandi og kaupandi eru íslenskir þá skal reikningurinn innihalda íslenska kennitölu kaupanda (BT-47).</assert>
|
||||
<assert id="IS-R-005" test="exists(cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:Party/cac:PostalAddress/cbc:PostalZone)" flag="fatal">[IS-R-005]-If seller and buyer are icelandic then the invoice shall contain the buyers address with street name and zip code — Ef seljandi og kaupandi eru íslenskir þá skal heimilisfang kaupanda innihalda götuheiti og póstnúmer (BT-50 og BT-53)</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- NETHERLANDS -->
|
||||
<pattern>
|
||||
<let name="supplierCountryIsNL" value="(upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')" />
|
||||
<let name="customerCountryIsNL" value="(upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')" />
|
||||
<let name="taxRepresentativeCountryIsNL" value="(upper-case(normalize-space(/*/cac:TaxRepresentativeParty/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')" />
|
||||
<rule context="cbc:CreditNoteTypeCode[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-9
|
||||
This rule has changed: since 384 is not an allowed invoice type code in PEPPOL BIS,
|
||||
this rule now only applies to credit notes
|
||||
-->
|
||||
<assert id="NL-R-001" test="/*/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID" flag="fatal">[NL-R-001] For suppliers in the Netherlands, if the document is a creditnote, the document MUST contain an invoice reference (cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-3 -->
|
||||
<assert id="NL-R-002" test="cbc:StreetName and cbc:CityName and cbc:PostalZone" flag="fatal">[NL-R-002] For suppliers in the Netherlands the supplier's address (cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-1 -->
|
||||
<assert id="NL-R-003" test="(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')" flag="fatal">[NL-R-003] For suppliers in the Netherlands, the legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingCustomerParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL and $customerCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-4 -->
|
||||
<assert id="NL-R-004" test="cbc:StreetName and cbc:CityName and cbc:PostalZone" flag="fatal">[NL-R-004] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer address (cac:AccountingCustomerParty/cac:Party/cac:PostalAddress) MUST contain the street name (cbc:StreetName), the city (cbc:CityName) and post code (cbc:PostalZone)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL and $customerCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-10 -->
|
||||
<assert id="NL-R-005" test="(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')" flag="fatal">[NL-R-005] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxRepresentativeParty/cac:PostalAddress[$supplierCountryIsNL and $taxRepresentativeCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-5 -->
|
||||
<assert id="NL-R-006" test="cbc:StreetName and cbc:CityName and cbc:PostalZone" flag="fatal">[NL-R-006] For suppliers in the Netherlands, if the fiscal representative is in the Netherlands, the representative's address (cac:TaxRepresentativeParty/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)</assert>
|
||||
</rule>
|
||||
<rule context="cac:LegalMonetaryTotal[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-11 -->
|
||||
<assert id="NL-R-007" test="(/ubl-invoice:Invoice and xs:decimal(cbc:PayableAmount) <= 0.0) or (/ubl-creditnote:CreditNote and xs:decimal(cbc:PayableAmount) >= 0.0) or (//cac:PaymentMeans)" flag="fatal">[NL-R-007] For suppliers in the Netherlands, the supplier MUST provide a means of payment (cac:PaymentMeans) if the payment is from customer to supplier</assert>
|
||||
</rule>
|
||||
<rule context="cac:PaymentMeans[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-12 -->
|
||||
<assert id="NL-R-008" test="normalize-space(cbc:PaymentMeansCode) = '30' or
|
||||
normalize-space(cbc:PaymentMeansCode) = '48' or
|
||||
normalize-space(cbc:PaymentMeansCode) = '49' or
|
||||
normalize-space(cbc:PaymentMeansCode) = '57' or
|
||||
normalize-space(cbc:PaymentMeansCode) = '58' or
|
||||
normalize-space(cbc:PaymentMeansCode) = '59'" flag="fatal">[NL-R-008] For suppliers in the Netherlands, the payment means code (cac:PaymentMeans/cbc:PaymentMeansCode) MUST be one of 30, 48, 49, 57, 58 or 59</assert>
|
||||
</rule>
|
||||
<rule context="cac:OrderLineReference/cbc:LineID[$supplierCountryIsNL]">
|
||||
<!-- Original rule in NLCIUS: BR-NL-13 -->
|
||||
<assert id="NL-R-009" test="exists(/*/cac:OrderReference/cbc:ID)" flag="fatal">[NL-R-009] For suppliers in the Netherlands, if an order line reference (cac:OrderLineReference/cbc:LineID) is used, there must be an order reference on the document level (cac:OrderReference/cbc:ID)</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<!-- Restricted code lists and formatting -->
|
||||
<pattern>
|
||||
<let name="ISO3166" value="tokenize('AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW 1A XI', '\s')"/>
|
||||
<let name="ISO4217" value="tokenize('AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL', '\s')"/>
|
||||
<let name="MIMECODE" value="tokenize('application/pdf image/png image/jpeg text/csv application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet', '\s')"/>
|
||||
<let name="UNCL2005" value="tokenize('3 35 432', '\s')"/>
|
||||
<let name="UNCL5189" value="tokenize('41 42 60 62 63 64 65 66 67 68 70 71 88 95 100 102 103 104 105', '\s')"/>
|
||||
<let name="UNCL7161" value="tokenize('AA AAA AAC AAD AAE AAF AAH AAI AAS AAT AAV AAY AAZ ABA ABB ABC ABD ABF ABK ABL ABN ABR ABS ABT ABU ACF ACG ACH ACI ACJ ACK ACL ACM ACS ADC ADE ADJ ADK ADL ADM ADN ADO ADP ADQ ADR ADT ADW ADY ADZ AEA AEB AEC AED AEF AEH AEI AEJ AEK AEL AEM AEN AEO AEP AES AET AEU AEV AEW AEX AEY AEZ AJ AU CA CAB CAD CAE CAF CAI CAJ CAK CAL CAM CAN CAO CAP CAQ CAR CAS CAT CAU CAV CAW CAX CAY CAZ CD CG CS CT DAB DAC DAD DAF DAG DAH DAI DAJ DAK DAL DAM DAN DAO DAP DAQ DL EG EP ER FAA FAB FAC FC FH FI GAA HAA HD HH IAA IAB ID IF IR IS KO L1 LA LAA LAB LF MAE MI ML NAA OA PA PAA PC PL RAB RAC RAD RAF RE RF RH RV SA SAA SAD SAE SAI SG SH SM SU TAB TAC TT TV V1 V2 WH XAA YY ZZZ', '\s')"/>
|
||||
<let name="UNCL5305" value="tokenize('AE E S Z G O K L M', '\s')"/>
|
||||
<let name="eaid" value="tokenize('0002 0007 0009 0037 0060 0088 0096 0097 0106 0130 0135 0142 0151 0183 0184 0188 0190 0191 0192 0193 0195 0196 0198 0199 0200 0201 0202 0204 0208 0209 0210 0211 0212 0213 0215 0216 0218 0221 0230 9901 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 9957 9959', '\s')"/>
|
||||
<rule context="cbc:EmbeddedDocumentBinaryObject[@mimeCode]">
|
||||
<assert id="PEPPOL-EN16931-CL001" test="
|
||||
some $code in $MIMECODE
|
||||
satisfies @mimeCode = $code" flag="fatal">Mime code must be according to subset of IANA code list.</assert>
|
||||
</rule>
|
||||
<rule context="cac:AllowanceCharge[cbc:ChargeIndicator = 'false']/cbc:AllowanceChargeReasonCode">
|
||||
<assert id="PEPPOL-EN16931-CL002" test="
|
||||
some $code in $UNCL5189
|
||||
satisfies normalize-space(text()) = $code" flag="fatal">Reason code MUST be according to subset of UNCL 5189 D.16B.</assert>
|
||||
</rule>
|
||||
<rule context="cac:AllowanceCharge[cbc:ChargeIndicator = 'true']/cbc:AllowanceChargeReasonCode">
|
||||
<assert id="PEPPOL-EN16931-CL003" test="
|
||||
some $code in $UNCL7161
|
||||
satisfies normalize-space(text()) = $code" flag="fatal">Reason code MUST be according to UNCL 7161 D.16B.</assert>
|
||||
</rule>
|
||||
<rule context="cac:InvoicePeriod/cbc:DescriptionCode">
|
||||
<assert id="PEPPOL-EN16931-CL006" test="
|
||||
some $code in $UNCL2005
|
||||
satisfies normalize-space(text()) = $code" flag="fatal">Invoice period description code must be according to UNCL 2005 D.16B.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount">
|
||||
<assert id="PEPPOL-EN16931-CL007" test="
|
||||
some $code in $ISO4217
|
||||
satisfies @currencyID = $code" flag="fatal">Currency code must be according to ISO 4217:2005</assert>
|
||||
</rule>
|
||||
<rule context="cbc:InvoiceTypeCode">
|
||||
<assert id="PEPPOL-EN16931-P0100" test="
|
||||
$profile != '01' or (some $code in tokenize('71 80 82 84 102 218 219 331 380 382 383 386 388 393 395 553 575 623 780 817 870 875 876 877', '\s')
|
||||
satisfies normalize-space(text()) = $code)" flag="fatal">Invoice type code MUST be set according to the profile.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:CreditNoteTypeCode">
|
||||
<assert id="PEPPOL-EN16931-P0101" test="
|
||||
$profile != '01' or (some $code in tokenize('381 396 81 83 532', '\s')
|
||||
satisfies normalize-space(text()) = $code)" flag="fatal">Credit note type code MUST be set according to the profile.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:IssueDate | cbc:DueDate | cbc:TaxPointDate | cbc:StartDate | cbc:EndDate | cbc:ActualDeliveryDate">
|
||||
<assert id="PEPPOL-EN16931-F001" test="string-length(text()) = 10 and (string(.) castable as xs:date)" flag="fatal">A date
|
||||
MUST be formatted YYYY-MM-DD.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID]">
|
||||
<assert id="PEPPOL-EN16931-CL008" test="
|
||||
some $code in $eaid
|
||||
satisfies @schemeID = $code" flag="fatal">Electronic address identifier scheme must be from the codelist "Electronic Address Identifier Scheme"</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-G']">
|
||||
<assert id="PEPPOL-EN16931-P0104" test="normalize-space(cbc:ID)='G'" flag="fatal">Tax Category G MUST be used when exemption reason code is VATEX-EU-G</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-O']">
|
||||
<assert id="PEPPOL-EN16931-P0105" test="normalize-space(cbc:ID)='O'" flag="fatal">Tax Category O MUST be used when exemption reason code is VATEX-EU-O</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-IC']">
|
||||
<assert id="PEPPOL-EN16931-P0106" test="normalize-space(cbc:ID)='K'" flag="fatal">Tax Category K MUST be used when exemption reason code is VATEX-EU-IC</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-AE']">
|
||||
<assert id="PEPPOL-EN16931-P0107" test="normalize-space(cbc:ID)='AE'" flag="fatal">Tax Category AE MUST be used when exemption reason code is VATEX-EU-AE</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-D']">
|
||||
<assert id="PEPPOL-EN16931-P0108" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-D</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-F']">
|
||||
<assert id="PEPPOL-EN16931-P0109" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-F</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-I']">
|
||||
<assert id="PEPPOL-EN16931-P0110" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-I</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-J']">
|
||||
<assert id="PEPPOL-EN16931-P0111" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-J</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
</schema>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,313 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><?xar XSLT?>
|
||||
|
||||
<!--
|
||||
OVERVIEW - iso_abstract_expand.xsl
|
||||
|
||||
This is a preprocessor for ISO Schematron, which implements abstract patterns.
|
||||
It also
|
||||
* extracts a particular schema using an ID, where there are multiple
|
||||
schemas, such as when they are embedded in the same NVDL script
|
||||
* allows parameter substitution inside @context, @test, @select, @path
|
||||
* experimentally, allows parameter recognition and substitution inside
|
||||
text (NOTE: to be removed, for compataibility with other implementations,
|
||||
please do not use this)
|
||||
|
||||
This should be used after iso-dsdl-include.xsl and before the skeleton or
|
||||
meta-stylesheet (e.g. iso-svrl.xsl) . It only requires XSLT 1.
|
||||
|
||||
Each kind of inclusion can be turned off (or on) on the command line.
|
||||
|
||||
-->
|
||||
|
||||
<!--
|
||||
Open Source Initiative OSI - The MIT License:Licensing
|
||||
[OSI Approved License]
|
||||
|
||||
This source code was previously available under the zlib/libpng license.
|
||||
Attribution is polite.
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2004-2010 Rick Jellife and Academia Sinica Computing Centre, Taiwan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<!--
|
||||
VERSION INFORMATION
|
||||
2013-09-19 RJ
|
||||
* Allow macro expansion in @path attributes, eg. for sch:name/@path
|
||||
|
||||
2010-07-10 RJ
|
||||
* Move to MIT license
|
||||
|
||||
2008-09-18 RJ
|
||||
* move out param test from iso:schema template to work with XSLT 1. (Noah Fontes)
|
||||
|
||||
2008-07-29 RJ
|
||||
* Create. Pull out as distinct XSL in its own namespace from old iso_pre_pro.xsl
|
||||
* Put everything in private namespace
|
||||
* Rewrite replace_substring named template so that copyright is clear
|
||||
|
||||
2008-07-24 RJ
|
||||
* correct abstract patterns so for correct names: param/@name and
|
||||
param/@value
|
||||
|
||||
2007-01-12 RJ
|
||||
* Use ISO namespace
|
||||
* Use pattern/@id not pattern/@name
|
||||
* Add Oliver Becker's suggests from old Schematron-love-in list for <copy>
|
||||
* Add XT -ism?
|
||||
2003 RJ
|
||||
* Original written for old namespace
|
||||
* http://www.topologi.com/resources/iso-pre-pro.xsl
|
||||
-->
|
||||
<xslt:stylesheet version="1.0" xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
||||
xmlns:nvdl="http://purl.oclc.org/dsdl/nvdl"
|
||||
|
||||
xmlns:iae="http://www.schematron.com/namespace/iae"
|
||||
|
||||
>
|
||||
|
||||
<xslt:param name="schema-id"></xslt:param>
|
||||
|
||||
|
||||
<!-- Driver for the mode -->
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="." mode="iae:go" />
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- ================================================================================== -->
|
||||
<!-- Normal processing rules -->
|
||||
<!-- ================================================================================== -->
|
||||
<!-- Output only the selected schema -->
|
||||
<xslt:template match="iso:schema" >
|
||||
<xsl:if test="string-length($schema-id) =0 or @id= $schema-id ">
|
||||
<xslt:copy>
|
||||
<xslt:copy-of select="@*" />
|
||||
<xslt:apply-templates mode="iae:go" />
|
||||
</xslt:copy>
|
||||
</xsl:if>
|
||||
</xslt:template>
|
||||
|
||||
|
||||
<!-- Strip out any foreign elements above the Schematron schema .
|
||||
-->
|
||||
<xslt:template match="*[not(ancestor-or-self::iso:*)]" mode="iae:go" >
|
||||
<xslt:apply-templates mode="iae:go" />
|
||||
</xslt:template>
|
||||
|
||||
|
||||
<!-- ================================================================================== -->
|
||||
<!-- Handle Schematron abstract pattern preprocessing -->
|
||||
<!-- abstract-to-real calls
|
||||
do-pattern calls
|
||||
macro-expand calls
|
||||
multi-macro-expand
|
||||
replace-substring -->
|
||||
<!-- ================================================================================== -->
|
||||
|
||||
<!--
|
||||
Abstract patterns allow you to say, for example
|
||||
|
||||
<pattern name="htmlTable" is-a="table">
|
||||
<param name="row" value="html:tr"/>
|
||||
<param name="cell" value="html:td" />
|
||||
<param name="table" value="html:table" />
|
||||
</pattern>
|
||||
|
||||
For a good introduction, see Uche Ogbujii's article for IBM DeveloperWorks
|
||||
"Discover the flexibility of Schematron abstract patterns"
|
||||
http://www-128.ibm.com/developerworks/xml/library/x-stron.html
|
||||
However, note that ISO Schematron uses @name and @value attributes on
|
||||
the iso:param element, and @id not @name on the pattern element.
|
||||
|
||||
-->
|
||||
|
||||
<!-- Suppress declarations of abstract patterns -->
|
||||
<xslt:template match="iso:pattern[@abstract='true']" mode="iae:go" >
|
||||
<xslt:comment>Suppressed abstract pattern <xslt:value-of select="@id"/> was here</xslt:comment>
|
||||
</xslt:template>
|
||||
|
||||
|
||||
<!-- Suppress uses of abstract patterns -->
|
||||
<xslt:template match="iso:pattern[@is-a]" mode="iae:go" >
|
||||
|
||||
<xslt:comment>Start pattern based on abstract <xslt:value-of select="@is-a"/></xslt:comment>
|
||||
|
||||
<xslt:call-template name="iae:abstract-to-real" >
|
||||
<xslt:with-param name="caller" select="@id" />
|
||||
<xslt:with-param name="is-a" select="@is-a" />
|
||||
</xslt:call-template>
|
||||
|
||||
</xslt:template>
|
||||
|
||||
|
||||
|
||||
<!-- output everything else unchanged -->
|
||||
<xslt:template match="*" priority="-1" mode="iae:go" >
|
||||
<xslt:copy>
|
||||
<xslt:copy-of select="@*" />
|
||||
<xslt:apply-templates mode="iae:go"/>
|
||||
</xslt:copy>
|
||||
</xslt:template>
|
||||
|
||||
<!-- Templates for macro expansion of abstract patterns -->
|
||||
<!-- Sets up the initial conditions for the recursive call -->
|
||||
<xslt:template name="iae:macro-expand">
|
||||
<xslt:param name="caller"/>
|
||||
<xslt:param name="text" />
|
||||
<xslt:call-template name="iae:multi-macro-expand">
|
||||
<xslt:with-param name="caller" select="$caller"/>
|
||||
<xslt:with-param name="text" select="$text"/>
|
||||
<xslt:with-param name="paramNumber" select="1"/>
|
||||
</xslt:call-template>
|
||||
|
||||
</xslt:template>
|
||||
|
||||
<!-- Template to replace the current parameter and then
|
||||
recurse to replace subsequent parameters. -->
|
||||
|
||||
<xslt:template name="iae:multi-macro-expand">
|
||||
<xslt:param name="caller"/>
|
||||
<xslt:param name="text" />
|
||||
<xslt:param name="paramNumber" />
|
||||
|
||||
|
||||
<xslt:choose>
|
||||
<xslt:when test="//iso:pattern[@id=$caller]/iso:param[ $paramNumber]">
|
||||
|
||||
<xslt:call-template name="iae:multi-macro-expand">
|
||||
<xslt:with-param name="caller" select="$caller"/>
|
||||
<xslt:with-param name="paramNumber" select="$paramNumber + 1"/>
|
||||
<xslt:with-param name="text" >
|
||||
<xslt:call-template name="iae:replace-substring">
|
||||
<xslt:with-param name="original" select="$text"/>
|
||||
<xslt:with-param name="substring"
|
||||
select="concat('$', //iso:pattern[@id=$caller]/iso:param[ $paramNumber ]/@name)"/>
|
||||
<xslt:with-param name="replacement"
|
||||
select="//iso:pattern[@id=$caller]/iso:param[ $paramNumber ]/@value"/>
|
||||
</xslt:call-template>
|
||||
</xslt:with-param>
|
||||
</xslt:call-template>
|
||||
</xslt:when>
|
||||
<xslt:otherwise><xslt:value-of select="$text" /></xslt:otherwise>
|
||||
|
||||
</xslt:choose>
|
||||
</xslt:template>
|
||||
|
||||
|
||||
<!-- generate the real pattern from an abstract pattern + parameters-->
|
||||
<xslt:template name="iae:abstract-to-real" >
|
||||
<xslt:param name="caller"/>
|
||||
<xslt:param name="is-a" />
|
||||
<xslt:for-each select="//iso:pattern[@id= $is-a]">
|
||||
<xslt:copy>
|
||||
|
||||
<xslt:choose>
|
||||
<xslt:when test=" string-length( $caller ) = 0">
|
||||
<xslt:attribute name="id"><xslt:value-of select="concat( generate-id(.) , $is-a)" /></xslt:attribute>
|
||||
</xslt:when>
|
||||
<xslt:otherwise>
|
||||
<xslt:attribute name="id"><xslt:value-of select="$caller" /></xslt:attribute>
|
||||
</xslt:otherwise>
|
||||
</xslt:choose>
|
||||
|
||||
<xslt:apply-templates select="*|text()" mode="iae:do-pattern" >
|
||||
<xslt:with-param name="caller"><xslt:value-of select="$caller"/></xslt:with-param>
|
||||
</xslt:apply-templates>
|
||||
|
||||
</xslt:copy>
|
||||
</xslt:for-each>
|
||||
</xslt:template>
|
||||
|
||||
|
||||
<!-- Generate a non-abstract pattern -->
|
||||
<xslt:template mode="iae:do-pattern" match="*">
|
||||
<xslt:param name="caller"/>
|
||||
<xslt:copy>
|
||||
<xslt:for-each select="@*[name()='test' or name()='context' or name()='select' or name()='path' ]">
|
||||
<xslt:attribute name="{name()}">
|
||||
<xslt:call-template name="iae:macro-expand">
|
||||
<xslt:with-param name="text"><xslt:value-of select="."/></xslt:with-param>
|
||||
<xslt:with-param name="caller"><xslt:value-of select="$caller"/></xslt:with-param>
|
||||
</xslt:call-template>
|
||||
</xslt:attribute>
|
||||
</xslt:for-each>
|
||||
<xslt:copy-of select="@*[name()!='test'][name()!='context'][name()!='select'][name()!='path']" />
|
||||
<xsl:for-each select="node()">
|
||||
<xsl:choose>
|
||||
<!-- Experiment: replace macros in text as well, to allow parameterized assertions
|
||||
and so on, without having to have spurious <iso:value-of> calls and multiple
|
||||
delimiting.
|
||||
NOTE: THIS FUNCTIONALITY WILL BE REMOVED IN THE FUTURE -->
|
||||
<xsl:when test="self::text()">
|
||||
<xslt:call-template name="iae:macro-expand">
|
||||
<xslt:with-param name="text"><xslt:value-of select="."/></xslt:with-param>
|
||||
<xslt:with-param name="caller"><xslt:value-of select="$caller"/></xslt:with-param>
|
||||
</xslt:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xslt:apply-templates select="." mode="iae:do-pattern">
|
||||
<xslt:with-param name="caller"><xslt:value-of select="$caller"/></xslt:with-param>
|
||||
</xslt:apply-templates>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xslt:copy>
|
||||
</xslt:template>
|
||||
|
||||
<!-- UTILITIES -->
|
||||
<!-- Simple version of replace-substring function -->
|
||||
<xslt:template name="iae:replace-substring">
|
||||
<xslt:param name="original" />
|
||||
<xslt:param name="substring" />
|
||||
<xslt:param name="replacement" select="''"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="not($original)" />
|
||||
<xsl:when test="not(string($substring))">
|
||||
<xsl:value-of select="$original" />
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($original, $substring)">
|
||||
<xsl:variable name="before" select="substring-before($original, $substring)" />
|
||||
<xsl:variable name="after" select="substring-after($original, $substring)" />
|
||||
|
||||
<xsl:value-of select="$before" />
|
||||
<xsl:value-of select="$replacement" />
|
||||
<!-- recursion -->
|
||||
<xsl:call-template name="iae:replace-substring">
|
||||
<xsl:with-param name="original" select="$after" />
|
||||
<xsl:with-param name="substring" select="$substring" />
|
||||
<xsl:with-param name="replacement" select="$replacement" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- no substitution -->
|
||||
<xsl:value-of select="$original" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xslt:template>
|
||||
|
||||
|
||||
|
||||
</xslt:stylesheet>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,691 @@
|
|||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
ISO_SVRL.xsl
|
||||
|
||||
Implementation of Schematron Validation Report Language from ISO Schematron
|
||||
ISO/IEC 19757 Document Schema Definition Languages (DSDL)
|
||||
Part 3: Rule-based validation Schematron
|
||||
Annex D: Schematron Validation Report Language
|
||||
|
||||
This ISO Standard is available free as a Publicly Available Specification in PDF from ISO.
|
||||
Also see www.schematron.com for drafts and other information.
|
||||
|
||||
This implementation of SVRL is designed to run with the "Skeleton" implementation
|
||||
of Schematron which Oliver Becker devised. The skeleton code provides a
|
||||
Schematron implementation but with named templates for handling all output;
|
||||
the skeleton provides basic templates for output using this API, but client
|
||||
validators can be written to import the skeleton and override the default output
|
||||
templates as required. (In order to understand this, you must understand that
|
||||
a named template such as "process-assert" in this XSLT stylesheet overrides and
|
||||
replaces any template with the same name in the imported skeleton XSLT file.)
|
||||
|
||||
The other important thing to understand in this code is that there are different
|
||||
versions of the Schematron skeleton. These track the development of Schematron through
|
||||
Schematron 1.5, Schematron 1.6 and now ISO Schematron. One only skeleton must be
|
||||
imported. The code has templates for the different skeletons commented out for
|
||||
convenience. ISO Schematron has a different namespace than Schematron 1.5 and 1.6;
|
||||
so the ISO Schematron skeleton has been written itself with an optional import
|
||||
statement to in turn import the Schematron 1.6 skeleton. This will allow you to
|
||||
validate with schemas from either namespace.
|
||||
|
||||
|
||||
History:
|
||||
2010-07-10
|
||||
* MIT license
|
||||
2010-04-14
|
||||
* Add command line parameter 'terminate' which will terminate on first failed
|
||||
assert and (optionally) successful report.
|
||||
2009-03-18
|
||||
* Fix atrribute with space "see " which generates wrong name in some processors
|
||||
* rename allow-foreign to allow-rich
|
||||
|
||||
2009-02-19
|
||||
* RJ add experimental non-standard attribute active-pattern/@document which says which
|
||||
document is being validated from that point to the next similar. This is to cope with the
|
||||
experimental multi-document validation in the XSLT2 skeleton.
|
||||
2008-08-19
|
||||
* RJ Experimental: Handle property elements. NOTE: signature change for process-assert,
|
||||
process-report and process-rule to add property.
|
||||
2008-08-11
|
||||
* RJ Fix attribute/@select which saxon allows in XSLT 1
|
||||
2008-08-07
|
||||
* RJ Add output-encoding attribute to specify final encoding to use
|
||||
* Alter allow-foreign functionality so that Schematron span, emph and dir elements make
|
||||
it to the output, for better formatting and because span can be used to mark up
|
||||
semantically interesting information embedded in diagnostics, which reduces the
|
||||
need to extend SVRL itself
|
||||
* Diagnostic-reference had an invalid attribute @id that duplicated @diagnostic: removed
|
||||
2008-08-06
|
||||
* RJ Fix invalid output: svrl:diagnostic-reference is not contained in an svrl:text
|
||||
* Output comment to SVRL file giving filename if available (from command-line parameter)
|
||||
2008-08-04
|
||||
* RJ move sch: prefix to schold: prefix to prevent confusion (we want people to
|
||||
be able to switch from old namespace to new namespace without changing the
|
||||
sch: prefix, so it is better to keep that prefix completely out of the XSLT)
|
||||
* Extra signature fixes (PH)
|
||||
2008-08-03
|
||||
* Repair missing class parameter on process-p
|
||||
2008-07-31
|
||||
* Update skeleton names
|
||||
2007-04-03
|
||||
* Add option generate-fired-rule (RG)
|
||||
2007-02-07
|
||||
* Prefer true|false for parameters. But allow yes|no on some old for compatability
|
||||
* DP Diagnostics output to svrl:text. Diagnosis put out after assertion text.
|
||||
* Removed non-SVRL elements and attributes: better handled as an extra layer that invokes this one
|
||||
* Add more formal parameters
|
||||
* Correct confusion between $schemaVersion and $queryBinding
|
||||
* Indent
|
||||
* Validate against RNC schemas for XSLT 1 and 2 (with regex tests removed)
|
||||
* Validate output with UniversalTest.sch against RNC schema for ISO SVRL
|
||||
|
||||
2007-02-01
|
||||
* DP. Update formal parameters of overriding named templates to handle more attributes.
|
||||
* DP. Refactor handling of rich and linkable parameters to a named template.
|
||||
|
||||
2007-01-22
|
||||
* DP change svrl:ns to svrl:ns-in-attribute-value
|
||||
* Change default when no queryBinding from "unknown" to "xslt"
|
||||
|
||||
2007-01-18:
|
||||
* Improve documentation
|
||||
* KH Add command-line options to generate paths or not
|
||||
* Use axsl:attribute rather than xsl:attribute to shut XSLT2 up
|
||||
* Add extra command-line options to pass to the iso_schematron_skeleton
|
||||
|
||||
2006-12-01: iso_svrl.xsl Rick Jelliffe,
|
||||
* update namespace,
|
||||
* update phase handling,
|
||||
* add flag param to process-assert and process-report & @ flag on output
|
||||
|
||||
2001: Conformance1-5.xsl Rick Jelliffe,
|
||||
* Created, using the skeleton code contributed by Oliver Becker
|
||||
-->
|
||||
<!--
|
||||
Open Source Initiative OSI - The MIT License:Licensing
|
||||
[OSI Approved License]
|
||||
|
||||
This source code was previously available under the zlib/libpng license.
|
||||
Attribution is polite.
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2004-2010 Rick Jellife and Academia Sinica Computing Centre, Taiwan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- Ideas nabbed from schematrons by Francis N., Miloslav N. and David C. -->
|
||||
|
||||
<!-- The command-line parameters are:
|
||||
phase NMTOKEN | "#ALL" (default) Select the phase for validation
|
||||
allow-foreign "true" | "false" (default) Pass non-Schematron elements and rich markup to the generated stylesheet
|
||||
diagnose= true | false|yes|no Add the diagnostics to the assertion test in reports (yes|no are obsolete)
|
||||
property= true | false Experimental: Add properties to the assertion test in reports
|
||||
generate-paths=true|false|yes|no generate the @location attribute with XPaths (yes|no are obsolete)
|
||||
sch.exslt.imports semi-colon delimited string of filenames for some EXSLT implementations
|
||||
optimize "visit-no-attributes" Use only when the schema has no attributes as the context nodes
|
||||
generate-fired-rule "true"(default) | "false" Generate fired-rule elements
|
||||
terminate= yes | no | true | false | assert Terminate on the first failed assertion or successful report
|
||||
Note: whether any output at all is generated depends on the XSLT implementation.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
|
||||
xmlns:schold="http://www.ascc.net/xml/schematron"
|
||||
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
||||
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
|
||||
|
||||
>
|
||||
|
||||
<!-- Select the import statement and adjust the path as
|
||||
necessary for your system.
|
||||
-->
|
||||
<xsl:import href="iso_schematron_skeleton_for_saxon.xsl"/>
|
||||
|
||||
<!--
|
||||
<xsl:import href="iso_schematron_skeleton_for_xslt1.xsl"/>
|
||||
|
||||
<xsl:import href="iso_schematron_skeleton.xsl"/>
|
||||
<xsl:import href="skeleton1-5.xsl"/>
|
||||
<xsl:import href="skeleton1-6.xsl"/>
|
||||
-->
|
||||
|
||||
<xsl:param name="diagnose">true</xsl:param>
|
||||
<xsl:param name="property">true</xsl:param>
|
||||
<xsl:param name="phase">
|
||||
<xsl:choose>
|
||||
<!-- Handle Schematron 1.5 and 1.6 phases -->
|
||||
<xsl:when test="//schold:schema/@defaultPhase">
|
||||
<xsl:value-of select="//schold:schema/@defaultPhase"/>
|
||||
</xsl:when>
|
||||
<!-- Handle ISO Schematron phases -->
|
||||
<xsl:when test="//iso:schema/@defaultPhase">
|
||||
<xsl:value-of select="//iso:schema/@defaultPhase"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>#ALL</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:param>
|
||||
<xsl:param name="allow-foreign">false</xsl:param>
|
||||
<xsl:param name="generate-paths">true</xsl:param>
|
||||
<xsl:param name="generate-fired-rule">true</xsl:param>
|
||||
<xsl:param name="optimize" />
|
||||
<!-- e.g. saxon file.xml file.xsl "sch.exslt.imports=.../string.xsl;.../math.xsl" -->
|
||||
<xsl:param name="sch.exslt.imports" />
|
||||
|
||||
<xsl:param name="terminate" >false</xsl:param>
|
||||
|
||||
<!-- Set the language code for messages -->
|
||||
<xsl:param name="langCode">default</xsl:param>
|
||||
|
||||
<xsl:param name="output-encoding"/>
|
||||
|
||||
<!-- Set the default for schematron-select-full-path, i.e. the notation for svrl's @location-->
|
||||
<xsl:param name="full-path-notation">1</xsl:param>
|
||||
|
||||
|
||||
|
||||
<!-- Experimental: If this file called, then must be generating svrl -->
|
||||
<xsl:variable name="svrlTest" select="true()" />
|
||||
|
||||
|
||||
|
||||
<!-- ================================================================ -->
|
||||
|
||||
<xsl:template name="process-prolog">
|
||||
<axsl:output method="xml" omit-xml-declaration="no" standalone="yes"
|
||||
indent="yes">
|
||||
<xsl:if test=" string-length($output-encoding) > 0">
|
||||
<xsl:attribute name="encoding"><xsl:value-of select=" $output-encoding" /></xsl:attribute>
|
||||
</xsl:if>
|
||||
</axsl:output>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!-- Overrides skeleton.xsl -->
|
||||
<xsl:template name="process-root">
|
||||
<xsl:param name="title"/>
|
||||
<xsl:param name="contents" />
|
||||
<xsl:param name="queryBinding" >xslt1</xsl:param>
|
||||
<xsl:param name="schemaVersion" />
|
||||
<xsl:param name="id" />
|
||||
<xsl:param name="version"/>
|
||||
<!-- "Rich" parameters -->
|
||||
<xsl:param name="fpi" />
|
||||
<xsl:param name="icon" />
|
||||
<xsl:param name="lang" />
|
||||
<xsl:param name="see" />
|
||||
<xsl:param name="space" />
|
||||
|
||||
<svrl:schematron-output title="{$title}" schemaVersion="{$schemaVersion}" >
|
||||
<xsl:if test=" string-length( normalize-space( $phase )) > 0 and
|
||||
not( normalize-space( $phase ) = '#ALL') ">
|
||||
<axsl:attribute name="phase">
|
||||
<xsl:value-of select=" $phase " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<axsl:comment><axsl:value-of select="$archiveDirParameter"/>  
|
||||
<axsl:value-of select="$archiveNameParameter"/>  
|
||||
<axsl:value-of select="$fileNameParameter"/>  
|
||||
<axsl:value-of select="$fileDirParameter"/></axsl:comment>
|
||||
|
||||
|
||||
<xsl:apply-templates mode="do-schema-p" />
|
||||
<xsl:copy-of select="$contents" />
|
||||
</svrl:schematron-output>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="process-assert">
|
||||
<xsl:param name="test"/>
|
||||
<xsl:param name="diagnostics" />
|
||||
<xsl:param name="properties" />
|
||||
<xsl:param name="id" />
|
||||
<xsl:param name="flag" />
|
||||
<!-- "Linkable" parameters -->
|
||||
<xsl:param name="role"/>
|
||||
<xsl:param name="subject"/>
|
||||
<!-- "Rich" parameters -->
|
||||
<xsl:param name="fpi" />
|
||||
<xsl:param name="icon" />
|
||||
<xsl:param name="lang" />
|
||||
<xsl:param name="see" />
|
||||
<xsl:param name="space" />
|
||||
<svrl:failed-assert test="{$test}" >
|
||||
<xsl:if test="string-length( $id ) > 0">
|
||||
<axsl:attribute name="id">
|
||||
<xsl:value-of select=" $id " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test=" string-length( $flag ) > 0">
|
||||
<axsl:attribute name="flag">
|
||||
<xsl:value-of select=" $flag " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<!-- Process rich attributes. -->
|
||||
<xsl:call-template name="richParms">
|
||||
<xsl:with-param name="fpi" select="$fpi"/>
|
||||
<xsl:with-param name="icon" select="$icon"/>
|
||||
<xsl:with-param name="lang" select="$lang"/>
|
||||
<xsl:with-param name="see" select="$see" />
|
||||
<xsl:with-param name="space" select="$space" />
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name='linkableParms'>
|
||||
<xsl:with-param name="role" select="$role" />
|
||||
<xsl:with-param name="subject" select="$subject"/>
|
||||
</xsl:call-template>
|
||||
<xsl:if test=" $generate-paths = 'true' or $generate-paths= 'yes' ">
|
||||
<!-- true/false is the new way -->
|
||||
<axsl:attribute name="location">
|
||||
<axsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<svrl:text>
|
||||
<xsl:apply-templates mode="text" />
|
||||
|
||||
</svrl:text>
|
||||
<xsl:if test="$diagnose = 'yes' or $diagnose= 'true' ">
|
||||
<!-- true/false is the new way -->
|
||||
<xsl:call-template name="diagnosticsSplit">
|
||||
<xsl:with-param name="str" select="$diagnostics"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
<xsl:if test="$property= 'yes' or $property= 'true' ">
|
||||
<!-- true/false is the new way -->
|
||||
<xsl:call-template name="propertiesSplit">
|
||||
<xsl:with-param name="str" select="$properties"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
|
||||
</svrl:failed-assert>
|
||||
|
||||
|
||||
<xsl:if test=" $terminate = 'yes' or $terminate = 'true' ">
|
||||
<axsl:message terminate="yes">TERMINATING</axsl:message>
|
||||
</xsl:if>
|
||||
<xsl:if test=" $terminate = 'assert' ">
|
||||
<axsl:message terminate="yes">TERMINATING</axsl:message>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="process-report">
|
||||
<xsl:param name="id"/>
|
||||
<xsl:param name="test"/>
|
||||
<xsl:param name="diagnostics"/>
|
||||
<xsl:param name="flag" />
|
||||
<xsl:param name="properties"/>
|
||||
<!-- "Linkable" parameters -->
|
||||
<xsl:param name="role"/>
|
||||
<xsl:param name="subject"/>
|
||||
<!-- "Rich" parameters -->
|
||||
<xsl:param name="fpi" />
|
||||
<xsl:param name="icon" />
|
||||
<xsl:param name="lang" />
|
||||
<xsl:param name="see" />
|
||||
<xsl:param name="space" />
|
||||
<svrl:successful-report test="{$test}" >
|
||||
<xsl:if test=" string-length( $id ) > 0">
|
||||
<axsl:attribute name="id">
|
||||
<xsl:value-of select=" $id " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test=" string-length( $flag ) > 0">
|
||||
<axsl:attribute name="flag">
|
||||
<xsl:value-of select=" $flag " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Process rich attributes. -->
|
||||
<xsl:call-template name="richParms">
|
||||
<xsl:with-param name="fpi" select="$fpi"/>
|
||||
<xsl:with-param name="icon" select="$icon"/>
|
||||
<xsl:with-param name="lang" select="$lang"/>
|
||||
<xsl:with-param name="see" select="$see" />
|
||||
<xsl:with-param name="space" select="$space" />
|
||||
</xsl:call-template>
|
||||
<xsl:call-template name='linkableParms'>
|
||||
<xsl:with-param name="role" select="$role" />
|
||||
<xsl:with-param name="subject" select="$subject"/>
|
||||
</xsl:call-template>
|
||||
<xsl:if test=" $generate-paths = 'yes' or $generate-paths = 'true' ">
|
||||
<!-- true/false is the new way -->
|
||||
<axsl:attribute name="location">
|
||||
<axsl:apply-templates select="." mode="schematron-select-full-path"/>
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<svrl:text>
|
||||
<xsl:apply-templates mode="text" />
|
||||
|
||||
</svrl:text>
|
||||
<xsl:if test="$diagnose = 'yes' or $diagnose='true' ">
|
||||
<!-- true/false is the new way -->
|
||||
<xsl:call-template name="diagnosticsSplit">
|
||||
<xsl:with-param name="str" select="$diagnostics"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
<xsl:if test="$property = 'yes' or $property='true' ">
|
||||
<!-- true/false is the new way -->
|
||||
<xsl:call-template name="propertiesSplit">
|
||||
<xsl:with-param name="str" select="$properties"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
</svrl:successful-report>
|
||||
|
||||
|
||||
<xsl:if test=" $terminate = 'yes' or $terminate = 'true' ">
|
||||
<axsl:message terminate="yes" >TERMINATING</axsl:message>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<xsl:template name="process-diagnostic">
|
||||
<xsl:param name="id"/>
|
||||
<!-- Rich parameters -->
|
||||
<xsl:param name="fpi" />
|
||||
<xsl:param name="icon" />
|
||||
<xsl:param name="lang" />
|
||||
<xsl:param name="see" />
|
||||
<xsl:param name="space" />
|
||||
<svrl:diagnostic-reference diagnostic="{$id}" >
|
||||
<!--xsl:if test="string($id)">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="$id"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if-->
|
||||
<xsl:call-template name="richParms">
|
||||
<xsl:with-param name="fpi" select="$fpi"/>
|
||||
<xsl:with-param name="icon" select="$icon"/>
|
||||
<xsl:with-param name="lang" select="$lang"/>
|
||||
<xsl:with-param name="see" select="$see" />
|
||||
<xsl:with-param name="space" select="$space" />
|
||||
</xsl:call-template>
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
<xsl:apply-templates mode="text"/>
|
||||
|
||||
</svrl:diagnostic-reference>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Overrides skeleton -->
|
||||
<xsl:template name="process-dir" >
|
||||
<xsl:param name="value" />
|
||||
<xsl:choose>
|
||||
<xsl:when test=" $allow-foreign = 'true'">
|
||||
<xsl:copy-of select="."/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<!-- We generate too much whitespace rather than risking concatenation -->
|
||||
<axsl:text> </axsl:text>
|
||||
<xsl:apply-templates mode="inline-text"/>
|
||||
<axsl:text> </axsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Overrides skeleton -->
|
||||
<xsl:template name="process-emph" >
|
||||
<xsl:param name="class" />
|
||||
<xsl:choose>
|
||||
<xsl:when test=" $allow-foreign = 'true'">
|
||||
<xsl:copy-of select="."/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- We generate too much whitespace rather than risking concatenation -->
|
||||
<axsl:text> </axsl:text>
|
||||
<xsl:apply-templates mode="inline-text"/>
|
||||
<axsl:text> </axsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="process-rule">
|
||||
<xsl:param name="id"/>
|
||||
<xsl:param name="context"/>
|
||||
<xsl:param name="flag"/>
|
||||
<xsl:param name="properties" />
|
||||
<!-- "Linkable" parameters -->
|
||||
<xsl:param name="role"/>
|
||||
<xsl:param name="subject"/>
|
||||
<!-- "Rich" parameters -->
|
||||
<xsl:param name="fpi" />
|
||||
<xsl:param name="icon" />
|
||||
<xsl:param name="lang" />
|
||||
<xsl:param name="see" />
|
||||
<xsl:param name="space" />
|
||||
<xsl:if test=" $generate-fired-rule = 'true'">
|
||||
<svrl:fired-rule context="{$context}" >
|
||||
<xsl:if test=" string( $id )">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select=" $id " />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test=" string-length( $role ) > 0">
|
||||
<xsl:attribute name="role">
|
||||
<xsl:value-of select=" $role " />
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<!-- Process rich attributes. -->
|
||||
<xsl:call-template name="richParms">
|
||||
<xsl:with-param name="fpi" select="$fpi"/>
|
||||
<xsl:with-param name="icon" select="$icon"/>
|
||||
<xsl:with-param name="lang" select="$lang"/>
|
||||
<xsl:with-param name="see" select="$see" />
|
||||
<xsl:with-param name="space" select="$space" />
|
||||
</xsl:call-template>
|
||||
|
||||
|
||||
<xsl:if test="$property= 'yes' or $property= 'true' ">
|
||||
<!-- true/false is the new way -->
|
||||
<xsl:call-template name="propertiesSplit">
|
||||
<xsl:with-param name="str" select="$properties"/>
|
||||
</xsl:call-template>
|
||||
</xsl:if>
|
||||
|
||||
</svrl:fired-rule>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="process-ns">
|
||||
<xsl:param name="prefix"/>
|
||||
<xsl:param name="uri"/>
|
||||
<svrl:ns-prefix-in-attribute-values uri="{$uri}" prefix="{$prefix}" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="process-p">
|
||||
<xsl:param name="icon"/>
|
||||
<xsl:param name="class"/>
|
||||
<xsl:param name="id"/>
|
||||
<xsl:param name="lang"/>
|
||||
|
||||
<svrl:text>
|
||||
<xsl:apply-templates mode="text"/>
|
||||
</svrl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="process-pattern">
|
||||
<xsl:param name="name"/>
|
||||
<xsl:param name="id"/>
|
||||
<xsl:param name="is-a"/>
|
||||
|
||||
<!-- "Rich" parameters -->
|
||||
<xsl:param name="fpi" />
|
||||
<xsl:param name="icon" />
|
||||
<xsl:param name="lang" />
|
||||
<xsl:param name="see" />
|
||||
<xsl:param name="space" />
|
||||
<svrl:active-pattern >
|
||||
<axsl:attribute name="document">
|
||||
<axsl:value-of select="document-uri(/)" />
|
||||
</axsl:attribute><!-- If XSLT1 remove this -->
|
||||
<xsl:if test=" string( $id )">
|
||||
<axsl:attribute name="id">
|
||||
<xsl:value-of select=" $id " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test=" string( $name )">
|
||||
<axsl:attribute name="name">
|
||||
<xsl:value-of select=" $name " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:call-template name='richParms'>
|
||||
<xsl:with-param name="fpi" select="$fpi"/>
|
||||
<xsl:with-param name="icon" select="$icon"/>
|
||||
<xsl:with-param name="lang" select="$lang"/>
|
||||
<xsl:with-param name="see" select="$see" />
|
||||
<xsl:with-param name="space" select="$space" />
|
||||
</xsl:call-template>
|
||||
|
||||
<!-- ?? report that this screws up iso:title processing -->
|
||||
<xsl:apply-templates mode="do-pattern-p"/>
|
||||
<!-- ?? Seems that this apply-templates is never triggered DP -->
|
||||
<axsl:apply-templates />
|
||||
</svrl:active-pattern>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Overrides skeleton -->
|
||||
<xsl:template name="process-message" >
|
||||
<xsl:param name="pattern"/>
|
||||
<xsl:param name="role"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Overrides skeleton -->
|
||||
<xsl:template name="process-span" >
|
||||
<xsl:param name="class" />
|
||||
<xsl:choose>
|
||||
<xsl:when test=" $allow-foreign = 'true'">
|
||||
<xsl:copy-of select="."/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- We generate too much whitespace rather than risking concatenation -->
|
||||
<axsl:text> </axsl:text>
|
||||
<xsl:apply-templates mode="inline-text"/>
|
||||
<axsl:text> </axsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- =========================================================================== -->
|
||||
<!-- processing rich parameters. -->
|
||||
<xsl:template name='richParms'>
|
||||
<!-- "Rich" parameters -->
|
||||
<xsl:param name="fpi" />
|
||||
<xsl:param name="icon" />
|
||||
<xsl:param name="lang" />
|
||||
<xsl:param name="see" />
|
||||
<xsl:param name="space" />
|
||||
<!-- Process rich attributes. -->
|
||||
<xsl:if test=" $allow-foreign = 'true'">
|
||||
<xsl:if test="string($fpi)">
|
||||
<axsl:attribute name="fpi">
|
||||
<xsl:value-of select="$fpi "/>
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="string($icon)">
|
||||
<axsl:attribute name="icon">
|
||||
<xsl:value-of select="$icon"/>
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="string($see)">
|
||||
<axsl:attribute name="see">
|
||||
<xsl:value-of select="$see" />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
<xsl:if test="string($space)">
|
||||
<axsl:attribute name="xml:space">
|
||||
<xsl:value-of select="$space"/>
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="string($lang)">
|
||||
<axsl:attribute name="xml:lang">
|
||||
<xsl:value-of select="$lang"/>
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- processing linkable parameters. -->
|
||||
<xsl:template name='linkableParms'>
|
||||
<xsl:param name="role"/>
|
||||
<xsl:param name="subject"/>
|
||||
|
||||
<!-- ISO SVRL has a role attribute to match the Schematron role attribute -->
|
||||
<xsl:if test=" string($role )">
|
||||
<axsl:attribute name="role">
|
||||
<xsl:value-of select=" $role " />
|
||||
</axsl:attribute>
|
||||
</xsl:if>
|
||||
<!-- ISO SVRL does not have a subject attribute to match the Schematron subject attribute.
|
||||
Instead, the Schematron subject attribute is folded into the location attribute -->
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- ===================================================== -->
|
||||
<!-- Extension API: -->
|
||||
<!-- This allows the transmission of extra attributes on -->
|
||||
<!-- rules, asserts, reports, diagnostics. -->
|
||||
<!-- ===================================================== -->
|
||||
|
||||
|
||||
<!-- Overrides skeleton EXPERIMENTAL -->
|
||||
<!-- The $contents is for static contents, the $value is for dynamic contents -->
|
||||
<xsl:template name="process-property">
|
||||
<xsl:param name="id"/>
|
||||
<xsl:param name="name"/>
|
||||
<xsl:param name="value"/>
|
||||
<xsl:param name="contents"/>
|
||||
|
||||
<svrl:property id="{$id}" >
|
||||
<xsl:if test="$name">
|
||||
<xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$value">
|
||||
<xsl:attribute name="value"><xsl:value-of select="$value"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$contents">
|
||||
<xsl:copy-of select="$contents"/>
|
||||
</xsl:if>
|
||||
|
||||
</svrl:property>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,129 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
|
||||
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
|
||||
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>
|
||||
<cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
|
||||
<cbc:ID>DE-56197</cbc:ID>
|
||||
<cbc:IssueDate>2024-10-29</cbc:IssueDate>
|
||||
<cbc:DueDate>2024-11-28</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
|
||||
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
|
||||
<cbc:BuyerReference>Excepturi.</cbc:BuyerReference>
|
||||
<cac:InvoicePeriod>
|
||||
<cbc:StartDate>2024-10-29</cbc:StartDate>
|
||||
<cbc:EndDate>2024-11-28</cbc:EndDate>
|
||||
</cac:InvoicePeriod>
|
||||
<cac:OrderReference>
|
||||
<cbc:ID>Excepturi.</cbc:ID>
|
||||
</cac:OrderReference>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cbc:EndpointID schemeID="0204">DE923356489</cbc:EndpointID>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="0204">DE923356489</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>Untitled Company</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Dudweilerstr. 34b</cbc:StreetName>
|
||||
<cbc:CityName>Ost Alessa</cbc:CityName>
|
||||
<cbc:PostalZone>98060</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>DE923356489</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID schemeID="0204">DE923356489</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>Untitled Company</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:Name>Gunnar Mohr Holly Balistreri</cbc:Name>
|
||||
<cbc:ElectronicMail>eden07@runolfsdottir.com</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cbc:EndpointID schemeID="0204">ABC1234</cbc:EndpointID>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID schemeID="0204">715350497</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PartyName>
|
||||
<cbc:Name>German Client Name</cbc:Name>
|
||||
</cac:PartyName>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Kinderhausen 96b</cbc:StreetName>
|
||||
<cbc:AdditionalStreetName>Apt. 842</cbc:AdditionalStreetName>
|
||||
<cbc:CityName>Süd Jessestadt</cbc:CityName>
|
||||
<cbc:PostalZone>33323</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>German Client Name</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
<cac:Contact>
|
||||
<cbc:ElectronicMail>No Email Set</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode>30</cbc:PaymentMeansCode>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>DE89370400440532013000</cbc:ID>
|
||||
<cbc:Name>PFA-NAME</cbc:Name>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="EUR">18.05</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">95</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">18.05</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">95</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="EUR">95</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="EUR">113.05</cbc:TaxInclusiveAmount>
|
||||
<cbc:PayableAmount currencyID="EUR">113.05</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">95</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>Product Description</cbc:Description>
|
||||
<cbc:Name>Product Key</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">9.5</cbc:PriceAmount>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="EUR">0.5</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">10</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
|
|
@ -0,0 +1,503 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:u="utils" schemaVersion="iso" queryBinding="xslt2">
|
||||
<title>Rules for Peppol BIS 3.0 Billing</title>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" prefix="cbc"/>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" prefix="cac"/>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" prefix="ubl-creditnote"/>
|
||||
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" prefix="ubl-invoice"/>
|
||||
<ns uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
|
||||
<ns uri="utils" prefix="u"/>
|
||||
|
||||
<let name="profile" value=" if (/*/cbc:ProfileID and matches(normalize-space(/*/cbc:ProfileID), 'urn:fdc:peppol.eu:2017:poacc:billing:([0-9]{2}):1.0')) then tokenize(normalize-space(/*/cbc:ProfileID), ':')[7] else 'Unknown'"/>
|
||||
<let name="supplierCountry" value=" if (/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) else 'XX'"/>
|
||||
<let name="customerCountry" value=" if (/*/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) else 'XX'"/>
|
||||
|
||||
<let name="documentCurrencyCode" value="/*/cbc:DocumentCurrencyCode"/>
|
||||
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:gln" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="length" select="string-length($val) - 1"/>
|
||||
<variable name="digits" select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
||||
<variable name="weightedSum" select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (1 + ((($i + 1) mod 2) * 2)))"/>
|
||||
<value-of select="(10 - ($weightedSum mod 10)) mod 10 = number(substring($val, $length + 1, 1))"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:slack" as="xs:boolean">
|
||||
<param name="exp" as="xs:decimal"/>
|
||||
<param name="val" as="xs:decimal"/>
|
||||
<param name="slack" as="xs:decimal"/>
|
||||
<value-of select="xs:decimal($exp + $slack) >= $val and xs:decimal($exp - $slack) <= $val"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:mod11" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="length" select="string-length($val) - 1"/>
|
||||
<variable name="digits" select="reverse(for $i in string-to-codepoints(substring($val, 0, $length + 1)) return $i - 48)"/>
|
||||
<variable name="weightedSum" select="sum(for $i in (0 to $length - 1) return $digits[$i + 1] * (($i mod 6) + 2))"/>
|
||||
<value-of select="number($val) > 0 and (11 - ($weightedSum mod 11)) mod 11 = number(substring($val, $length + 1, 1))"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:mod97-0208" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<variable name="checkdigits" select="substring($val,9,2)"/>
|
||||
<variable name="calculated_digits" select="xs:string(97 - (xs:integer(substring($val,1,8)) mod 97))"/>
|
||||
<value-of select="number($checkdigits) = number($calculated_digits)"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkCodiceIPA" as="xs:boolean">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789</variable>
|
||||
<sequence select="if ( (string-length(translate($arg, $allowed-characters, '')) = 0) and (string-length($arg) = 6) ) then true() else false()"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkCF" as="xs:boolean">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<sequence select=" if ( (string-length($arg) = 16) or (string-length($arg) = 11) ) then ( if ((string-length($arg) = 16)) then ( if (u:checkCF16($arg)) then ( true() ) else ( false() ) ) else ( if(($arg castable as xs:integer)) then true() else false() ) ) else ( false() ) "/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkCF16" as="xs:boolean">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<variable name="allowed-characters">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</variable>
|
||||
<sequence select=" if ( (string-length(translate(substring($arg,1,6), $allowed-characters, '')) = 0) and (substring($arg,7,2) castable as xs:integer) and (string-length(translate(substring($arg,9,1), $allowed-characters, '')) = 0) and (substring($arg,10,2) castable as xs:integer) and (substring($arg,12,3) castable as xs:string) and (substring($arg,15,1) castable as xs:integer) and (string-length(translate(substring($arg,16,1), $allowed-characters, '')) = 0) ) then true() else false() "/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkPIVAseIT" as="xs:boolean">
|
||||
<param name="arg" as="xs:string"/>
|
||||
<variable name="paese" select="substring($arg,1,2)"/>
|
||||
<variable name="codice" select="substring($arg,3)"/>
|
||||
<sequence select=" if ( $paese = 'IT' or $paese = 'it' ) then ( if ( ( string-length($codice) = 11 ) and ( if (u:checkPIVA($codice)!=0) then false() else true() )) then ( true() ) else ( false() ) ) else ( true() ) "/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkPIVA" as="xs:integer">
|
||||
<param name="arg" as="xs:string?"/>
|
||||
<sequence select=" if (not($arg castable as xs:integer)) then 1 else ( u:addPIVA($arg,xs:integer(0)) mod 10 )"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:addPIVA" as="xs:integer">
|
||||
<param name="arg" as="xs:string"/>
|
||||
<param name="pari" as="xs:integer"/>
|
||||
<variable name="tappo" select="if (not($arg castable as xs:integer)) then 0 else 1"/>
|
||||
<variable name="mapper" select="if ($tappo = 0) then 0 else ( if ($pari = 1) then ( xs:integer(substring('0246813579', ( xs:integer(substring($arg,1,1)) +1 ) ,1)) ) else ( xs:integer(substring($arg,1,1) ) ) )"/>
|
||||
<sequence select="if ($tappo = 0) then $mapper else ( xs:integer($mapper) + u:addPIVA(substring(xs:string($arg),2), (if($pari=0) then 1 else 0) ) )"/>
|
||||
</function>
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:abn" as="xs:boolean">
|
||||
<param name="val"/>
|
||||
<value-of select="( ((string-to-codepoints(substring($val,1,1)) - 49) * 10) + ((string-to-codepoints(substring($val,2,1)) - 48) * 1) + ((string-to-codepoints(substring($val,3,1)) - 48) * 3) + ((string-to-codepoints(substring($val,4,1)) - 48) * 5) + ((string-to-codepoints(substring($val,5,1)) - 48) * 7) + ((string-to-codepoints(substring($val,6,1)) - 48) * 9) + ((string-to-codepoints(substring($val,7,1)) - 48) * 11) + ((string-to-codepoints(substring($val,8,1)) - 48) * 13) + ((string-to-codepoints(substring($val,9,1)) - 48) * 15) + ((string-to-codepoints(substring($val,10,1)) - 48) * 17) + ((string-to-codepoints(substring($val,11,1)) - 48) * 19)) mod 89 = 0 "/>
|
||||
</function>
|
||||
|
||||
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:TinVerification" as="xs:boolean">
|
||||
<param name="val" as="xs:string"/>
|
||||
<variable name="digits" select=" for $ch in string-to-codepoints($val) return codepoints-to-string($ch)"/>
|
||||
<variable name="checksum" select=" (number($digits[8])*2) + (number($digits[7])*4) + (number($digits[6])*8) + (number($digits[5])*16) + (number($digits[4])*32) + (number($digits[3])*64) + (number($digits[2])*128) + (number($digits[1])*256) "/>
|
||||
<value-of select="($checksum mod 11) mod 10 = number($digits[9])"/>
|
||||
</function>
|
||||
|
||||
|
||||
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkSEOrgnr" as="xs:boolean">
|
||||
<param name="number" as="xs:string"/>
|
||||
<choose>
|
||||
|
||||
<when test="not(matches($number, '^\d+$'))">
|
||||
<sequence select="false()"/>
|
||||
</when>
|
||||
<otherwise>
|
||||
|
||||
<variable name="mainPart" select="substring($number, 1, 9)"/>
|
||||
<variable name="checkDigit" select="substring($number, 10, 1)"/>
|
||||
<variable name="sum" as="xs:integer">
|
||||
<value-of select="sum( for $pos in 1 to string-length($mainPart) return if ($pos mod 2 = 1) then (number(substring($mainPart, string-length($mainPart) - $pos + 1, 1)) * 2) mod 10 + (number(substring($mainPart, string-length($mainPart) - $pos + 1, 1)) * 2) idiv 10 else number(substring($mainPart, string-length($mainPart) - $pos + 1, 1)) )"/>
|
||||
</variable>
|
||||
<variable name="calculatedCheckDigit" select="(10 - $sum mod 10) mod 10"/>
|
||||
<sequence select="$calculatedCheckDigit = number($checkDigit)"/>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</function>
|
||||
|
||||
<pattern>
|
||||
<rule context="//*[not(*) and not(normalize-space())]">
|
||||
<assert id="PEPPOL-EN16931-R008" test="false()" flag="fatal">Document MUST not contain empty elements.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<rule context="ubl-creditnote:CreditNote">
|
||||
<assert id="PEPPOL-EN16931-R080" test="(count(cac:AdditionalDocumentReference[cbc:DocumentTypeCode='50']) <= 1)" flag="fatal">Only one project reference is allowed on document level</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
<pattern>
|
||||
|
||||
<rule context="ubl-creditnote:CreditNote | ubl-invoice:Invoice">
|
||||
<assert id="PEPPOL-EN16931-R001" test="cbc:ProfileID" flag="fatal">Business process MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R007" test="$profile != 'Unknown'" flag="fatal">Business process MUST be in the format 'urn:fdc:peppol.eu:2017:poacc:billing:NN:1.0' where NN indicates the process number.</assert>
|
||||
<assert id="PEPPOL-EN16931-R002" test="count(cbc:Note) <= 1" flag="fatal">No more than one note is allowed on document level.</assert>
|
||||
<assert id="PEPPOL-EN16931-R003" test="cbc:BuyerReference or cac:OrderReference/cbc:ID" flag="fatal">A buyer reference or purchase order reference MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R004" test="starts-with(normalize-space(cbc:CustomizationID/text()), 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0')" flag="fatal">Specification identifier MUST have the value 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'.</assert>
|
||||
<assert id="PEPPOL-EN16931-R053" test="count(cac:TaxTotal[cac:TaxSubtotal]) = 1" flag="fatal">Only one tax total with tax subtotals MUST be provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R054" test="count(cac:TaxTotal[not(cac:TaxSubtotal)]) = (if (cbc:TaxCurrencyCode) then 1 else 0)" flag="fatal">Only one tax total without tax subtotals MUST be provided when tax currency code is provided.</assert>
|
||||
<assert id="PEPPOL-EN16931-R055" test="not(cbc:TaxCurrencyCode) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] <= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] <= 0) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] >= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] >= 0) " flag="fatal">Invoice total VAT amount and Invoice total VAT amount in accounting currency MUST have the same operational sign</assert>
|
||||
</rule>
|
||||
<rule context="cbc:TaxCurrencyCode">
|
||||
<assert id="PEPPOL-EN16931-R005" test="not(normalize-space(text()) = normalize-space(../cbc:DocumentCurrencyCode/text()))" flag="fatal">VAT accounting currency code MUST be different from invoice currency code when provided.</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AccountingCustomerParty/cac:Party">
|
||||
<assert id="PEPPOL-EN16931-R010" test="cbc:EndpointID" flag="fatal">Buyer electronic address MUST be provided</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party">
|
||||
<assert id="PEPPOL-EN16931-R020" test="cbc:EndpointID" flag="fatal">Seller electronic address MUST be provided</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="ubl-invoice:Invoice/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[cbc:MultiplierFactorNumeric and not(cbc:BaseAmount)]">
|
||||
<assert id="PEPPOL-EN16931-R041" test="false()" flag="fatal">Allowance/charge base amount MUST be provided when allowance/charge percentage is provided.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount] | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge[not(cbc:MultiplierFactorNumeric) and cbc:BaseAmount]">
|
||||
<assert id="PEPPOL-EN16931-R042" test="false()" flag="fatal">Allowance/charge percentage MUST be provided when allowance/charge base amount is provided.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice/cac:AllowanceCharge | ubl-invoice:Invoice/cac:InvoiceLine/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:AllowanceCharge | ubl-creditnote:CreditNote/cac:CreditNoteLine/cac:AllowanceCharge">
|
||||
<assert id="PEPPOL-EN16931-R040" test=" not(cbc:MultiplierFactorNumeric and cbc:BaseAmount) or u:slack(if (cbc:Amount) then cbc:Amount else 0, (xs:decimal(cbc:BaseAmount) * xs:decimal(cbc:MultiplierFactorNumeric)) div 100, 0.02)" flag="fatal">Allowance/charge amount must equal base amount * percentage/100 if base amount and percentage exists</assert>
|
||||
<assert id="PEPPOL-EN16931-R043" test="normalize-space(cbc:ChargeIndicator/text()) = 'true' or normalize-space(cbc:ChargeIndicator/text()) = 'false'" flag="fatal">Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'</assert>
|
||||
</rule>
|
||||
|
||||
<rule context=" cac:PaymentMeans[some $code in tokenize('49 59', '\s') satisfies normalize-space(cbc:PaymentMeansCode) = $code]">
|
||||
<assert id="PEPPOL-EN16931-R061" test="cac:PaymentMandate/cbc:ID" flag="fatal">Mandate reference MUST be provided for direct debit.</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount">
|
||||
<assert id="PEPPOL-EN16931-R051" test="@currencyID = $documentCurrencyCode" flag="fatal">All currencyID attributes must have the same value as the invoice currency code (BT-5), except for the invoice total VAT amount in accounting currency (BT-111).</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="ubl-invoice:Invoice[cac:InvoicePeriod/cbc:StartDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:StartDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:StartDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:StartDate">
|
||||
<assert id="PEPPOL-EN16931-R110" test="xs:date(text()) >= xs:date(../../../cac:InvoicePeriod/cbc:StartDate)" flag="fatal">Start date of line period MUST be within invoice period.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice[cac:InvoicePeriod/cbc:EndDate]/cac:InvoiceLine/cac:InvoicePeriod/cbc:EndDate | ubl-creditnote:CreditNote[cac:InvoicePeriod/cbc:EndDate]/cac:CreditNoteLine/cac:InvoicePeriod/cbc:EndDate">
|
||||
<assert id="PEPPOL-EN16931-R111" test="xs:date(text()) <= xs:date(../../../cac:InvoicePeriod/cbc:EndDate)" flag="fatal">End date of line period MUST be within invoice period.</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:InvoiceLine | cac:CreditNoteLine">
|
||||
<let name="lineExtensionAmount" value=" if (cbc:LineExtensionAmount) then xs:decimal(cbc:LineExtensionAmount) else 0"/>
|
||||
<let name="quantity" value=" if (/ubl-invoice:Invoice) then (if (cbc:InvoicedQuantity) then xs:decimal(cbc:InvoicedQuantity) else 1) else (if (cbc:CreditedQuantity) then xs:decimal(cbc:CreditedQuantity) else 1)"/>
|
||||
<let name="priceAmount" value=" if (cac:Price/cbc:PriceAmount) then xs:decimal(cac:Price/cbc:PriceAmount) else 0"/>
|
||||
<let name="baseQuantity" value=" if (cac:Price/cbc:BaseQuantity and xs:decimal(cac:Price/cbc:BaseQuantity) != 0) then xs:decimal(cac:Price/cbc:BaseQuantity) else 1"/>
|
||||
<let name="allowancesTotal" value=" if (cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'false']) then round(sum(cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'false']/cbc:Amount/xs:decimal(.)) * 10 * 10) div 100 else 0"/>
|
||||
<let name="chargesTotal" value=" if (cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'true']) then round(sum(cac:AllowanceCharge[normalize-space(cbc:ChargeIndicator) = 'true']/cbc:Amount/xs:decimal(.)) * 10 * 10) div 100 else 0"/>
|
||||
<assert id="PEPPOL-EN16931-R120" test="u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, 0.02)" flag="fatal">Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount</assert>
|
||||
<assert id="PEPPOL-EN16931-R121" test="not(cac:Price/cbc:BaseQuantity) or xs:decimal(cac:Price/cbc:BaseQuantity) > 0" flag="fatal">Base quantity MUST be a positive number above zero.</assert>
|
||||
<assert id="PEPPOL-EN16931-R100" test="(count(cac:DocumentReference) <= 1)" flag="fatal">Only one invoiced object is allowed pr line</assert>
|
||||
<assert id="PEPPOL-EN16931-R101" test="(not(cac:DocumentReference) or (cac:DocumentReference/cbc:DocumentTypeCode='130'))" flag="fatal">Element Document reference can only be used for Invoice line object</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:Price/cac:AllowanceCharge">
|
||||
<assert id="PEPPOL-EN16931-R044" test="normalize-space(cbc:ChargeIndicator) = 'false'" flag="fatal">Charge on price level is NOT allowed. Only value 'false' allowed.</assert>
|
||||
<assert id="PEPPOL-EN16931-R046" test="not(cbc:BaseAmount) or xs:decimal(../cbc:PriceAmount) = xs:decimal(cbc:BaseAmount) - xs:decimal(cbc:Amount)" flag="fatal">Item net price MUST equal (Gross price - Allowance amount) when gross price is provided.</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:Price/cbc:BaseQuantity[@unitCode]">
|
||||
<let name="hasQuantity" value="../../cbc:InvoicedQuantity or ../../cbc:CreditedQuantity"/>
|
||||
<let name="quantity" value=" if (/ubl-invoice:Invoice) then ../../cbc:InvoicedQuantity else ../../cbc:CreditedQuantity"/>
|
||||
<assert id="PEPPOL-EN16931-R130" test="not($hasQuantity) or @unitCode = $quantity/@unitCode" flag="fatal">Unit code of price base quantity MUST be same as invoiced quantity.</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cbc:EndpointID[@schemeID = '0088'] | cac:PartyIdentification/cbc:ID[@schemeID = '0088'] | cbc:CompanyID[@schemeID = '0088']">
|
||||
<assert id="PEPPOL-COMMON-R040" test="matches(normalize-space(), '^[0-9]+$') and u:gln(normalize-space())" flag="fatal">GLN must have a valid format according to GS1 rules.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0192'] | cac:PartyIdentification/cbc:ID[@schemeID = '0192'] | cbc:CompanyID[@schemeID = '0192']">
|
||||
<assert id="PEPPOL-COMMON-R041" test="matches(normalize-space(), '^[0-9]{9}$') and u:mod11(normalize-space())" flag="fatal">Norwegian organization number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0184'] | cac:PartyIdentification/cbc:ID[@schemeID = '0184'] | cbc:CompanyID[@schemeID = '0184']">
|
||||
<assert id="PEPPOL-COMMON-R042" test="(string-length(text()) = 10) and (substring(text(), 1, 2) = 'DK') and (string-length(translate(substring(text(), 3, 8), '1234567890', '')) = 0)" flag="fatal">Danish organization number (CVR) MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0208'] | cac:PartyIdentification/cbc:ID[@schemeID = '0208'] | cbc:CompanyID[@schemeID = '0208']">
|
||||
<assert id="PEPPOL-COMMON-R043" test="matches(normalize-space(), '^[0-9]{10}$') and u:mod97-0208(normalize-space())" flag="fatal">Belgian enterprise number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0201'] | cac:PartyIdentification/cbc:ID[@schemeID = '0201'] | cbc:CompanyID[@schemeID = '0201']">
|
||||
<assert id="PEPPOL-COMMON-R044" test="u:checkCodiceIPA(normalize-space())" flag="warning">IPA Code (Codice Univoco Unità Organizzativa) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0210'] | cac:PartyIdentification/cbc:ID[@schemeID = '0210'] | cbc:CompanyID[@schemeID = '0210']">
|
||||
<assert id="PEPPOL-COMMON-R045" test="u:checkCF(normalize-space())" flag="warning">Tax Code (Codice Fiscale) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '9907']">
|
||||
<assert id="PEPPOL-COMMON-R046" test="u:checkCF(normalize-space())" flag="warning">Tax Code (Codice Fiscale) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0211'] | cac:PartyIdentification/cbc:ID[@schemeID = '0211'] | cbc:CompanyID[@schemeID = '0211']">
|
||||
<assert id="PEPPOL-COMMON-R047" test="u:checkPIVAseIT(normalize-space())" flag="warning">Italian VAT Code (Partita Iva) must be stated in the correct format</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cbc:EndpointID[@schemeID = '0007'] | cac:PartyIdentification/cbc:ID[@schemeID = '0007'] | cbc:CompanyID[@schemeID = '0007']">
|
||||
<assert id="PEPPOL-COMMON-R049" test="string-length(normalize-space()) = 10 and string(number(normalize-space())) != 'NaN' and u:checkSEOrgnr(normalize-space())" flag="fatal">Swedish organization number MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID = '0151'] | cac:PartyIdentification/cbc:ID[@schemeID = '0151'] | cbc:CompanyID[@schemeID = '0151']">
|
||||
<assert id="PEPPOL-COMMON-R050" test="matches(normalize-space(), '^[0-9]{11}$') and u:abn(normalize-space())" flag="fatal">Australian Business Number (ABN) MUST be stated in the correct format.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'NO']">
|
||||
<assert id="NO-R-002" test="normalize-space(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'TAX']/cbc:CompanyID) = 'Foretaksregisteret'" flag="warning">For Norwegian suppliers, most invoice issuers are required to append "Foretaksregisteret" to their
|
||||
invoice. "Dersom selger er aksjeselskap, allmennaksjeselskap eller filial av utenlandsk
|
||||
selskap skal også ordet «Foretaksregisteret» fremgå av salgsdokumentet, jf.
|
||||
foretaksregisterloven § 10-2."</assert>
|
||||
<assert id="NO-R-001" test="cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO' and matches(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID,3), '^[0-9]{9}MVA$') and u:mod11(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID, 3, 9)) or not(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO')" flag="fatal">For Norwegian suppliers, a VAT number MUST be the country code prefix NO followed by a valid Norwegian organization number (nine numbers) followed by the letters MVA.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<let name="DKSupplierCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
<let name="DKCustomerCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
|
||||
<rule context="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK'] | ubl-invoice:Invoice[$DKSupplierCountry = 'DK']">
|
||||
<assert id="DK-R-002" test="(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/text()) != '')" flag="fatal">Danish suppliers MUST provide legal entity (CVR-number)</assert>
|
||||
<assert id="DK-R-014" test="not(((boolean(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID)) and (normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID) != '0184')) )" flag="fatal">For Danish Suppliers it is mandatory to specify schemeID as "0184" (DK CVR-number) when PartyLegalEntity/CompanyID is used for AccountingSupplierParty</assert>
|
||||
<assert id="DK-R-016" test="not((boolean(/ubl-creditnote:CreditNote) and ($DKCustomerCountry = 'DK')) and (number(cac:LegalMonetaryTotal/cbc:PayableAmount/text()) < 0) )" flag="fatal">For Danish Suppliers, a Credit note cannot have a negative total (PayableAmount)</assert>
|
||||
</rule>
|
||||
<rule context="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification">
|
||||
<assert id="DK-R-013" test="not((boolean(cbc:ID)) and (normalize-space(cbc:ID/@schemeID) = '') )" flag="fatal">For Danish Suppliers it is mandatory to use schemeID when PartyIdentification/ID is used for AccountingCustomerParty or AccountingSupplierParty</assert>
|
||||
</rule>
|
||||
<rule context="ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:PaymentMeans">
|
||||
<assert id="DK-R-005" test="contains(' 1 10 31 42 48 49 50 58 59 93 97 ', concat(' ', cbc:PaymentMeansCode, ' '))" flag="fatal">For Danish suppliers the following Payment means codes are allowed: 1, 10, 31, 42, 48, 49, 50, 58, 59, 93 and 97</assert>
|
||||
<assert id="DK-R-006" test="not(((cbc:PaymentMeansCode = '31') or (cbc:PaymentMeansCode = '42')) and not((normalize-space(cac:PayeeFinancialAccount/cbc:ID/text()) != '') and (normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID/text()) != '')) )" flag="fatal">For Danish suppliers bank account and registration account is mandatory if payment means is 31 or 42</assert>
|
||||
<assert id="DK-R-007" test="not((cbc:PaymentMeansCode = '49') and not((normalize-space(cac:PaymentMandate/cbc:ID/text()) != '') and (normalize-space(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID/text()) != '')) )" flag="fatal">For Danish suppliers PaymentMandate/ID and PayerFinancialAccount/ID are mandatory when payment means is 49</assert>
|
||||
<assert id="DK-R-008" test="not((cbc:PaymentMeansCode = '50') and not(((substring(cbc:PaymentID, 1, 3) = '01#') or (substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 7) ) )" flag="fatal">For Danish Suppliers PaymentID is mandatory and MUST start with 01#, 04# or 15# (kortartkode), and PayeeFinancialAccount/ID (Giro kontonummer) is mandatory and must be 7 characters long, when payment means equals 50 (Giro)</assert>
|
||||
<assert id="DK-R-009" test="not((cbc:PaymentMeansCode = '50') and ((substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and not(string-length(cbc:PaymentID) = 19) )" flag="fatal">For Danish Suppliers if the PaymentID is prefixed with 04# or 15# the 16 digits instruction Id must be added to the PaymentID eg. "04#1234567890123456" when Payment means equals 50 (Giro)</assert>
|
||||
<assert id="DK-R-010" test="not((cbc:PaymentMeansCode = '93') and not(((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '73#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 8) ) )" flag="fatal">For Danish Suppliers the PaymentID is mandatory and MUST start with 71#, 73# or 75# (kortartkode) and PayeeFinancialAccount/ID (Kreditornummer) is mandatory and must be exactly 8 characters long, when Payment means equals 93 (FIK)</assert>
|
||||
<assert id="DK-R-011" test="not((cbc:PaymentMeansCode = '93') and ((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and not((string-length(cbc:PaymentID) = 18) or (string-length(cbc:PaymentID) = 19)) )" flag="fatal">For Danish Suppliers if the PaymentID is prefixed with 71# or 75# the 15-16 digits instruction Id must be added to the PaymentID eg. "71#1234567890123456" when payment Method equals 93 (FIK)</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="ubl-creditnote:CreditNote[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:CreditNoteLine | ubl-invoice:Invoice[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']/cac:InvoiceLine">
|
||||
<assert id="DK-R-003" test="not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listID = 'TST') and not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.05.01') or (cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.0501') ) )" flag="warning">If ItemClassification is provided from Danish suppliers, UNSPSC version 19.0501 should be used.</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AllowanceCharge[$DKSupplierCountry = 'DK' and $DKCustomerCountry = 'DK']">
|
||||
<assert id="DK-R-004" test="not((cbc:AllowanceChargeReasonCode = 'ZZZ') and not((string-length(normalize-space(cbc:AllowanceChargeReason/text())) = 4) and (number(cbc:AllowanceChargeReason) >= 0) and (number(cbc:AllowanceChargeReason) <= 9999)) )" flag="fatal">When specifying non-VAT Taxes for Danish customers, Danish suppliers MUST use the AllowanceChargeReasonCode="ZZZ" and the 4-digit Tax category MUST be specified in AllowanceChargeReason</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) != 'VAT']">
|
||||
<assert id="IT-R-001" test="matches(normalize-space(cbc:CompanyID),'^[A-Z0-9]{11,16}$')" flag="fatal">[IT-R-001] BT-32 (Seller tax registration identifier) - For Italian suppliers BT-32 minimum length 11 and maximum length shall be 16. Per i fornitori italiani il BT-32 deve avere una lunghezza tra 11 e 16 caratteri</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$supplierCountry = 'IT']">
|
||||
<assert id="IT-R-002" test="cac:PostalAddress/cbc:StreetName" flag="fatal">[IT-R-002] BT-35 (Seller address line 1) - Italian suppliers MUST provide the postal address line 1 - I fornitori italiani devono indicare l'indirizzo postale.</assert>
|
||||
<assert id="IT-R-003" test="cac:PostalAddress/cbc:CityName" flag="fatal">[IT-R-003] BT-37 (Seller city) - Italian suppliers MUST provide the postal address city - I fornitori italiani devono indicare la città di residenza.</assert>
|
||||
<assert id="IT-R-004" test="cac:PostalAddress/cbc:PostalZone" flag="fatal">">[IT-R-004] BT-38 (Seller post code) - Italian suppliers MUST provide the postal address post code - I fornitori italiani devono indicare il CAP di residenza.</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<rule context="//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE']">
|
||||
<assert id="SE-R-001" test="string-length(normalize-space(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID)) = 14" flag="fatal">For Swedish suppliers, Swedish VAT-numbers must consist of 14 characters.</assert>
|
||||
<assert id="SE-R-002" test="string(number(substring(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID, 3, 12))) != 'NaN'" flag="fatal">For Swedish suppliers, the Swedish VAT-numbers must have the trailing 12 characters in numeric form</assert>
|
||||
</rule>
|
||||
<rule context="//cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity[../cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cbc:CompanyID]">
|
||||
<assert id="SE-R-003" test="string(number(cbc:CompanyID)) != 'NaN'" flag="warning">Swedish organisation numbers should be numeric.</assert>
|
||||
<assert id="SE-R-004" test="string-length(normalize-space(cbc:CompanyID)) = 10" flag="warning">Swedish organisation numbers consist of 10 characters.</assert>
|
||||
<assert id="SE-R-013" test="u:checkSEOrgnr(normalize-space(cbc:CompanyID))" flag="warning">The last digit of a Swedish organization number must be valid according to the Luhn algorithm.</assert>
|
||||
</rule>
|
||||
<rule context="//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and exists(cac:PartyLegalEntity/cbc:CompanyID)]/cac:PartyTaxScheme[normalize-space(upper-case(cac:TaxScheme/cbc:ID)) != 'VAT']/cbc:CompanyID">
|
||||
<assert id="SE-R-005" test="normalize-space(upper-case(.)) = 'GODKÄND FÖR F-SKATT'" flag="fatal">For Swedish suppliers, when using Seller tax registration identifier, 'Godkänd för F-skatt' must be stated</assert>
|
||||
</rule>
|
||||
<rule context="//cac:TaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S'] | //cac:ClassifiedTaxCategory[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE'] and cbc:ID = 'S']">
|
||||
<assert id="SE-R-006" test="number(cbc:Percent) = 25 or number(cbc:Percent) = 12 or number(cbc:Percent) = 6" flag="fatal">For Swedish suppliers, only standard VAT rate of 6, 12 or 25 are used</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:PLUSGIRO']/cac:PayeeFinancialAccount/cbc:ID">
|
||||
<assert id="SE-R-007" test="string(number(normalize-space(.))) != 'NaN'" flag="warning">For Swedish suppliers using Plusgiro, the Account ID must be numeric </assert>
|
||||
<assert id="SE-R-010" test="string-length(normalize-space(.)) >= 2 and string-length(normalize-space(.)) <= 8" flag="warning">For Swedish suppliers using Plusgiro, the Account ID must have 2-8 characters</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and normalize-space(cbc:PaymentMeansCode) = '30' and normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID) = 'SE:BANKGIRO']/cac:PayeeFinancialAccount/cbc:ID">
|
||||
<assert id="SE-R-008" test="string(number(normalize-space(.))) != 'NaN'" flag="warning">For Swedish suppliers using Bankgiro, the Account ID must be numeric </assert>
|
||||
<assert id="SE-R-009" test="string-length(normalize-space(.)) = 7 or string-length(normalize-space(.)) = 8" flag="warning">For Swedish suppliers using Bankgiro, the Account ID must have 7-8 characters</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('50') or cbc:PaymentMeansCode = normalize-space('56'))]">
|
||||
<assert id="SE-R-011" test="false()" flag="warning">For Swedish suppliers using Swedish Bankgiro or Plusgiro, the proper way to indicate this is to use Code 30 for PaymentMeans and FinancialInstitutionBranch ID with code SE:BANKGIRO or SE:PLUSGIRO</assert>
|
||||
</rule>
|
||||
<rule context="//cac:PaymentMeans[//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and //cac:AccountingCustomerParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE'] and (cbc:PaymentMeansCode = normalize-space('31'))]">
|
||||
<assert id="SE-R-012" test="false()" flag="warning">For domestic transactions between Swedish trading partners, credit transfer should be indicated by PaymentMeansCode="30"</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
|
||||
<let name="isGreekSender" value="($supplierCountry ='GR') or ($supplierCountry ='EL')"/>
|
||||
<let name="isGreekReceiver" value="($customerCountry ='GR') or ($customerCountry ='EL')"/>
|
||||
<let name="isGreekSenderandReceiver" value="$isGreekSender and $isGreekReceiver"/>
|
||||
|
||||
<let name="accountingSupplierCountry" value=" if (/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2))) else if (/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) else 'XX'"/>
|
||||
|
||||
<pattern>
|
||||
<let name="dateRegExp" value="'^(0?[1-9]|[12][0-9]|3[01])[-\\/ ]?(0?[1-9]|1[0-2])[-\\/ ]?(19|20)[0-9]{2}'"/>
|
||||
<let name="greekDocumentType" value="tokenize('1.1 1.6 2.1 2.4 5.1 5.2 ','\s')"/>
|
||||
<let name="tokenizedUblIssueDate" value="tokenize(/*/cbc:IssueDate,'-')"/>
|
||||
|
||||
<rule context="/ubl-invoice:Invoice/cbc:ID[$isGreekSender] | /ubl-creditnote:CreditNote/cbc:ID[$isGreekSender]">
|
||||
<let name="IdSegments" value="tokenize(.,'\|')"/>
|
||||
<assert id="GR-R-001-1" test="count($IdSegments) = 6" flag="fatal"> When the Supplier is Greek, the Invoice Id should consist of 6 segments</assert>
|
||||
<assert id="GR-R-001-2" test="string-length(normalize-space($IdSegments[1])) = 9 and u:TinVerification($IdSegments[1]) and ($IdSegments[1] = /*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) or $IdSegments[1] = /*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) )" flag="fatal">When the Supplier is Greek, the Invoice Id first segment must be a valid TIN Number and match either the Supplier's or the Tax Representative's Tin Number</assert>
|
||||
<let name="tokenizedIdDate" value="tokenize($IdSegments[2],'/')"/>
|
||||
<assert id="GR-R-001-3" test="string-length(normalize-space($IdSegments[2]))>0 and matches($IdSegments[2],$dateRegExp) and ($tokenizedIdDate[1] = $tokenizedUblIssueDate[3] and $tokenizedIdDate[2] = $tokenizedUblIssueDate[2] and $tokenizedIdDate[3] = $tokenizedUblIssueDate[1])" flag="fatal">When the Supplier is Greek, the Invoice Id second segment must be a valid Date that matches the invoice Issue Date</assert>
|
||||
<assert id="GR-R-001-4" test="string-length(normalize-space($IdSegments[3]))>0 and string(number($IdSegments[3])) != 'NaN' and xs:integer($IdSegments[3]) >= 0" flag="fatal">When Supplier is Greek, the Invoice Id third segment must be a positive integer</assert>
|
||||
<assert id="GR-R-001-5" test="string-length(normalize-space($IdSegments[4]))>0 and (some $c in $greekDocumentType satisfies $IdSegments[4] = $c)" flag="fatal">When Supplier is Greek, the Invoice Id in the fourth segment must be a valid greek document type</assert>
|
||||
<assert id="GR-R-001-6" test="string-length($IdSegments[5]) > 0 " flag="fatal">When Supplier is Greek, the Invoice Id fifth segment must not be empty</assert>
|
||||
<assert id="GR-R-001-7" test="string-length($IdSegments[6]) > 0 " flag="fatal">When Supplier is Greek, the Invoice Id sixth segment must not be empty</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty[$isGreekSender]/cac:Party">
|
||||
|
||||
<assert id="GR-R-002" test="string-length(./cac:PartyName/cbc:Name)>0" flag="fatal">Greek Suppliers must provide their full name as they are registered in the Greek Business Registry (G.E.MH.) as a legal entity or in the Tax Registry as a natural person </assert>
|
||||
|
||||
<assert id="GR-S-011" test="count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))" flag="warning">Greek suppliers must provide their Seller Tax Registration Number, prefixed by the country code</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID">
|
||||
<assert id="GR-R-003" test="substring(.,1,2) = 'EL' and u:TinVerification(substring(.,3))" flag="fatal">For the Greek Suppliers, the VAT must start with 'EL' and must be a valid TIN number</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="/ubl-invoice:Invoice[$isGreekSender and ( /*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'GR')] | /ubl-creditnote:CreditNote[$isGreekSender and ( /*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'GR')]">
|
||||
|
||||
<assert id="GR-R-004-1" test="count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##M.AR.K##'])=1" flag="fatal"> When Supplier is Greek, there must be one MARK Number</assert>
|
||||
<assert id="GR-S-008-1" flag="warning" test="count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##'])=1"> When Supplier is Greek, there should be one invoice url</assert>
|
||||
<assert id="GR-R-008-2" test="(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 0 ) or (count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 1 )" flag="fatal"> When Supplier is Greek, there should be no more than one invoice url</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AdditionalDocumentReference[$isGreekSender and ( /*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'GR') and cbc:DocumentDescription = '##M.AR.K##']/cbc:ID">
|
||||
<assert id="GR-R-004-2" test="matches(.,'^[1-9]([0-9]*)')" flag="fatal"> When Supplier is Greek, the MARK Number must be a positive integer</assert>
|
||||
</rule>
|
||||
|
||||
|
||||
<rule context="cac:AdditionalDocumentReference[$isGreekSender and cbc:DocumentDescription = '##INVOICE|URL##']">
|
||||
<assert id="GR-R-008-3" test="string-length(normalize-space(cac:Attachment/cac:ExternalReference/cbc:URI))>0" flag="fatal">When Supplier is Greek and the INVOICE URL Document reference exists, the External Reference URI should be present</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AccountingCustomerParty[$isGreekSender]/cac:Party">
|
||||
<assert id="GR-R-005" test="string-length(./cac:PartyName/cbc:Name)>0" flag="fatal">Greek Suppliers must provide the full name of the buyer</assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party[$accountingSupplierCountry='GR' or $accountingSupplierCountry='EL']/cbc:EndpointID">
|
||||
<assert id="GR-R-009" test="./@schemeID='9933' and u:TinVerification(.)" flag="fatal">Greek suppliers that send an invoice through the PEPPOL network must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (schemeID 9933).</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
|
||||
<rule context="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party">
|
||||
<assert id="GR-R-006" test="count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))" flag="fatal">Greek Suppliers must provide the VAT number of the buyer, if the buyer is Greek </assert>
|
||||
</rule>
|
||||
|
||||
<rule context="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party/cbc:EndpointID">
|
||||
<assert id="GR-R-010" test="./@schemeID='9933' and u:TinVerification(.)" flag="fatal">Greek Suppliers that send an invoice through the PEPPOL network to a greek buyer must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (SchemeID 9933)</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<let name="SupplierCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
<let name="CustomerCountry" value="concat(ubl-creditnote:CreditNote/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode, ubl-invoice:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)"/>
|
||||
<rule context="ubl-creditnote:CreditNote[$SupplierCountry = 'IS'] | ubl-invoice:Invoice[$SupplierCountry = 'IS']">
|
||||
<assert id="IS-R-001" test="( ( not(contains(normalize-space(cbc:InvoiceTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:InvoiceTypeCode),' ') ) ) ) or ( ( not(contains(normalize-space(cbc:CreditNoteTypeCode),' ')) and contains( ' 380 381 ',concat(' ',normalize-space(cbc:CreditNoteTypeCode),' ') ) ) )" flag="warning">[IS-R-001]-If seller is icelandic then invoice type should be 380 or 381 — Ef seljandi er íslenskur þá ætti gerð reiknings (BT-3) að vera sölureikningur (380) eða kreditreikningur (381).</assert>
|
||||
<assert id="IS-R-002" test="exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'" flag="fatal">[IS-R-002]-If seller is icelandic then it shall contain sellers legal id — Ef seljandi er íslenskur þá skal reikningur innihalda íslenska kennitölu seljanda (BT-30).</assert>
|
||||
<assert id="IS-R-003" test="exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone)" flag="fatal">[IS-R-003]-If seller is icelandic then it shall contain his address with street name and zip code — Ef seljandi er íslenskur þá skal heimilisfang seljanda innihalda götuheiti og póstnúmer (BT-35 og BT-38).</assert>
|
||||
<assert id="IS-R-006" test="exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']))" flag="fatal">[IS-R-006]-If seller is icelandic and payment means code is 9 then a 12 digit account id must exist — Ef seljandi er íslenskur og greiðslumáti (BT-81) er krafa (kóti 9) þá skal koma fram 12 stafa númer (bankanúmer, höfuðbók 66 og reikningsnúmer) (BT-84)</assert>
|
||||
<assert id="IS-R-007" test="exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']))" flag="fatal">[IS-R-007]-If seller is icelandic and payment means code is 42 then a 12 digit account id must exist — Ef seljandi er íslenskur og greiðslumáti (BT-81) er millifærsla (kóti 42) þá skal koma fram 12 stafa reikningnúmer (BT-84)</assert>
|
||||
<assert id="IS-R-008" test="(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and string-length(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) = 10 and (string(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID) castable as xs:date)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))" flag="fatal">[IS-R-008]-If seller is icelandic and invoice contains supporting description EINDAGI then the id form must be YYYY-MM-DD — Ef seljandi er íslenskur þá skal eindagi (BT-122, DocumentDescription = EINDAGI) vera á forminu YYYY-MM-DD.</assert>
|
||||
<assert id="IS-R-009" test="(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and exists(cbc:DueDate)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))" flag="fatal">[IS-R-009]-If seller is icelandic and invoice contains supporting description EINDAGI invoice must have due date — Ef seljandi er íslenskur þá skal reikningur sem inniheldur eindaga (BT-122, DocumentDescription = EINDAGI) einnig hafa gjalddaga (BT-9).</assert>
|
||||
<assert id="IS-R-010" test="(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']) and (cbc:DueDate) <= (cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']/cbc:ID)) or not(exists(cac:AdditionalDocumentReference[cbc:DocumentDescription = 'EINDAGI']))" flag="fatal">[IS-R-010]-If seller is icelandic and invoice contains supporting description EINDAGI the id date must be same or later than due date — Ef seljandi er íslenskur þá skal eindagi (BT-122, DocumentDescription = EINDAGI) skal vera sami eða síðar en gjalddagi (BT-9) ef eindagi er til staðar.</assert>
|
||||
</rule>
|
||||
<rule context="ubl-creditnote:CreditNote[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty | ubl-invoice:Invoice[$SupplierCountry = 'IS' and $CustomerCountry = 'IS']/cac:AccountingCustomerParty">
|
||||
<assert id="IS-R-004" test="exists(cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'" flag="fatal">[IS-R-004]-If seller and buyer are icelandic then the invoice shall contain the buyers icelandic legal identifier — Ef seljandi og kaupandi eru íslenskir þá skal reikningurinn innihalda íslenska kennitölu kaupanda (BT-47).</assert>
|
||||
<assert id="IS-R-005" test="exists(cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:Party/cac:PostalAddress/cbc:PostalZone)" flag="fatal">[IS-R-005]-If seller and buyer are icelandic then the invoice shall contain the buyers address with street name and zip code — Ef seljandi og kaupandi eru íslenskir þá skal heimilisfang kaupanda innihalda götuheiti og póstnúmer (BT-50 og BT-53)</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<let name="supplierCountryIsNL" value="(upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')"/>
|
||||
<let name="customerCountryIsNL" value="(upper-case(normalize-space(/*/cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')"/>
|
||||
<let name="taxRepresentativeCountryIsNL" value="(upper-case(normalize-space(/*/cac:TaxRepresentativeParty/cac:PostalAddress/cac:Country/cbc:IdentificationCode)) = 'NL')"/>
|
||||
<rule context="cbc:CreditNoteTypeCode[$supplierCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-001" test="/*/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID" flag="fatal">[NL-R-001] For suppliers in the Netherlands, if the document is a creditnote, the document MUST contain an invoice reference (cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-002" test="cbc:StreetName and cbc:CityName and cbc:PostalZone" flag="fatal">[NL-R-002] For suppliers in the Netherlands the supplier's address (cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-003" test="(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')" flag="fatal">[NL-R-003] For suppliers in the Netherlands, the legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingCustomerParty/cac:Party/cac:PostalAddress[$supplierCountryIsNL and $customerCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-004" test="cbc:StreetName and cbc:CityName and cbc:PostalZone" flag="fatal">[NL-R-004] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer address (cac:AccountingCustomerParty/cac:Party/cac:PostalAddress) MUST contain the street name (cbc:StreetName), the city (cbc:CityName) and post code (cbc:PostalZone)</assert>
|
||||
</rule>
|
||||
<rule context="cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID[$supplierCountryIsNL and $customerCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-005" test="(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')" flag="fatal">[NL-R-005] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190)</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxRepresentativeParty/cac:PostalAddress[$supplierCountryIsNL and $taxRepresentativeCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-006" test="cbc:StreetName and cbc:CityName and cbc:PostalZone" flag="fatal">[NL-R-006] For suppliers in the Netherlands, if the fiscal representative is in the Netherlands, the representative's address (cac:TaxRepresentativeParty/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)</assert>
|
||||
</rule>
|
||||
<rule context="cac:LegalMonetaryTotal[$supplierCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-007" test="(/ubl-invoice:Invoice and xs:decimal(cbc:PayableAmount) <= 0.0) or (/ubl-creditnote:CreditNote and xs:decimal(cbc:PayableAmount) >= 0.0) or (//cac:PaymentMeans)" flag="fatal">[NL-R-007] For suppliers in the Netherlands, the supplier MUST provide a means of payment (cac:PaymentMeans) if the payment is from customer to supplier</assert>
|
||||
</rule>
|
||||
<rule context="cac:PaymentMeans[$supplierCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-008" test="normalize-space(cbc:PaymentMeansCode) = '30' or normalize-space(cbc:PaymentMeansCode) = '48' or normalize-space(cbc:PaymentMeansCode) = '49' or normalize-space(cbc:PaymentMeansCode) = '57' or normalize-space(cbc:PaymentMeansCode) = '58' or normalize-space(cbc:PaymentMeansCode) = '59'" flag="fatal">[NL-R-008] For suppliers in the Netherlands, the payment means code (cac:PaymentMeans/cbc:PaymentMeansCode) MUST be one of 30, 48, 49, 57, 58 or 59</assert>
|
||||
</rule>
|
||||
<rule context="cac:OrderLineReference/cbc:LineID[$supplierCountryIsNL]">
|
||||
|
||||
<assert id="NL-R-009" test="exists(/*/cac:OrderReference/cbc:ID)" flag="fatal">[NL-R-009] For suppliers in the Netherlands, if an order line reference (cac:OrderLineReference/cbc:LineID) is used, there must be an order reference on the document level (cac:OrderReference/cbc:ID)</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
|
||||
<pattern>
|
||||
<let name="ISO3166" value="tokenize('AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW 1A XI', '\s')"/>
|
||||
<let name="ISO4217" value="tokenize('AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL', '\s')"/>
|
||||
<let name="MIMECODE" value="tokenize('application/pdf image/png image/jpeg text/csv application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet', '\s')"/>
|
||||
<let name="UNCL2005" value="tokenize('3 35 432', '\s')"/>
|
||||
<let name="UNCL5189" value="tokenize('41 42 60 62 63 64 65 66 67 68 70 71 88 95 100 102 103 104 105', '\s')"/>
|
||||
<let name="UNCL7161" value="tokenize('AA AAA AAC AAD AAE AAF AAH AAI AAS AAT AAV AAY AAZ ABA ABB ABC ABD ABF ABK ABL ABN ABR ABS ABT ABU ACF ACG ACH ACI ACJ ACK ACL ACM ACS ADC ADE ADJ ADK ADL ADM ADN ADO ADP ADQ ADR ADT ADW ADY ADZ AEA AEB AEC AED AEF AEH AEI AEJ AEK AEL AEM AEN AEO AEP AES AET AEU AEV AEW AEX AEY AEZ AJ AU CA CAB CAD CAE CAF CAI CAJ CAK CAL CAM CAN CAO CAP CAQ CAR CAS CAT CAU CAV CAW CAX CAY CAZ CD CG CS CT DAB DAC DAD DAF DAG DAH DAI DAJ DAK DAL DAM DAN DAO DAP DAQ DL EG EP ER FAA FAB FAC FC FH FI GAA HAA HD HH IAA IAB ID IF IR IS KO L1 LA LAA LAB LF MAE MI ML NAA OA PA PAA PC PL RAB RAC RAD RAF RE RF RH RV SA SAA SAD SAE SAI SG SH SM SU TAB TAC TT TV V1 V2 WH XAA YY ZZZ', '\s')"/>
|
||||
<let name="UNCL5305" value="tokenize('AE E S Z G O K L M', '\s')"/>
|
||||
<let name="eaid" value="tokenize('0002 0007 0009 0037 0060 0088 0096 0097 0106 0130 0135 0142 0151 0183 0184 0188 0190 0191 0192 0193 0195 0196 0198 0199 0200 0201 0202 0204 0208 0209 0210 0211 0212 0213 0215 0216 0218 0221 0230 9901 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 9957 9959', '\s')"/>
|
||||
<rule context="cbc:EmbeddedDocumentBinaryObject[@mimeCode]">
|
||||
<assert id="PEPPOL-EN16931-CL001" test=" some $code in $MIMECODE satisfies @mimeCode = $code" flag="fatal">Mime code must be according to subset of IANA code list.</assert>
|
||||
</rule>
|
||||
<rule context="cac:AllowanceCharge[cbc:ChargeIndicator = 'false']/cbc:AllowanceChargeReasonCode">
|
||||
<assert id="PEPPOL-EN16931-CL002" test=" some $code in $UNCL5189 satisfies normalize-space(text()) = $code" flag="fatal">Reason code MUST be according to subset of UNCL 5189 D.16B.</assert>
|
||||
</rule>
|
||||
<rule context="cac:AllowanceCharge[cbc:ChargeIndicator = 'true']/cbc:AllowanceChargeReasonCode">
|
||||
<assert id="PEPPOL-EN16931-CL003" test=" some $code in $UNCL7161 satisfies normalize-space(text()) = $code" flag="fatal">Reason code MUST be according to UNCL 7161 D.16B.</assert>
|
||||
</rule>
|
||||
<rule context="cac:InvoicePeriod/cbc:DescriptionCode">
|
||||
<assert id="PEPPOL-EN16931-CL006" test=" some $code in $UNCL2005 satisfies normalize-space(text()) = $code" flag="fatal">Invoice period description code must be according to UNCL 2005 D.16B.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:Amount | cbc:BaseAmount | cbc:PriceAmount | cbc:TaxAmount | cbc:TaxableAmount | cbc:LineExtensionAmount | cbc:TaxExclusiveAmount | cbc:TaxInclusiveAmount | cbc:AllowanceTotalAmount | cbc:ChargeTotalAmount | cbc:PrepaidAmount | cbc:PayableRoundingAmount | cbc:PayableAmount">
|
||||
<assert id="PEPPOL-EN16931-CL007" test=" some $code in $ISO4217 satisfies @currencyID = $code" flag="fatal">Currency code must be according to ISO 4217:2005</assert>
|
||||
</rule>
|
||||
<rule context="cbc:InvoiceTypeCode">
|
||||
<assert id="PEPPOL-EN16931-P0100" test=" $profile != '01' or (some $code in tokenize('71 80 82 84 102 218 219 331 380 382 383 386 388 393 395 553 575 623 780 817 870 875 876 877', '\s') satisfies normalize-space(text()) = $code)" flag="fatal">Invoice type code MUST be set according to the profile.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:CreditNoteTypeCode">
|
||||
<assert id="PEPPOL-EN16931-P0101" test=" $profile != '01' or (some $code in tokenize('381 396 81 83 532', '\s') satisfies normalize-space(text()) = $code)" flag="fatal">Credit note type code MUST be set according to the profile.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:IssueDate | cbc:DueDate | cbc:TaxPointDate | cbc:StartDate | cbc:EndDate | cbc:ActualDeliveryDate">
|
||||
<assert id="PEPPOL-EN16931-F001" test="string-length(text()) = 10 and (string(.) castable as xs:date)" flag="fatal">A date
|
||||
MUST be formatted YYYY-MM-DD.</assert>
|
||||
</rule>
|
||||
<rule context="cbc:EndpointID[@schemeID]">
|
||||
<assert id="PEPPOL-EN16931-CL008" test=" some $code in $eaid satisfies @schemeID = $code" flag="fatal">Electronic address identifier scheme must be from the codelist "Electronic Address Identifier Scheme"</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-G']">
|
||||
<assert id="PEPPOL-EN16931-P0104" test="normalize-space(cbc:ID)='G'" flag="fatal">Tax Category G MUST be used when exemption reason code is VATEX-EU-G</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-O']">
|
||||
<assert id="PEPPOL-EN16931-P0105" test="normalize-space(cbc:ID)='O'" flag="fatal">Tax Category O MUST be used when exemption reason code is VATEX-EU-O</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-IC']">
|
||||
<assert id="PEPPOL-EN16931-P0106" test="normalize-space(cbc:ID)='K'" flag="fatal">Tax Category K MUST be used when exemption reason code is VATEX-EU-IC</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-AE']">
|
||||
<assert id="PEPPOL-EN16931-P0107" test="normalize-space(cbc:ID)='AE'" flag="fatal">Tax Category AE MUST be used when exemption reason code is VATEX-EU-AE</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-D']">
|
||||
<assert id="PEPPOL-EN16931-P0108" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-D</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-F']">
|
||||
<assert id="PEPPOL-EN16931-P0109" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-F</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-I']">
|
||||
<assert id="PEPPOL-EN16931-P0110" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-I</assert>
|
||||
</rule>
|
||||
<rule context="cac:TaxCategory[upper-case(cbc:TaxExemptionReasonCode)='VATEX-EU-J']">
|
||||
<assert id="PEPPOL-EN16931-P0111" test="normalize-space(cbc:ID)='E'" flag="fatal">Tax Category E MUST be used when exemption reason code is VATEX-EU-J</assert>
|
||||
</rule>
|
||||
</pattern>
|
||||
</schema>
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue