Views: 111
Open Peppolの電子インボイスは、XMLの電子商取引の世界標準 UBL 2.1に基づいて作成される。
XMLスキーマで定義される文字データ要素は、UTF-8コードでの漢字を含めた多バイトのデータが使えるので、その内容を制限したいときには注意する。
先ずは、UBLのデータ型について
UBLのデータ型
UBLは、UN/ECEのCore Component Technical Specification (CCTS)に従ってデータ型を定義している。
次のスキーマでCore Component Typeが定義され、それを参照してデータ型を定義している。
CCTS_CCT_SchemaModule
文字データには、xsd:stringから派生定義するものとxsd:normalizedstringから派生定義するものがあるが、そのどちらも英数字や記号だけでなく漢字を含む文字列が使用できる。
UBLのデータ型は、次で定義されている。
UBL-UnqualifiedDataTypes
UBLのデータ型は、基本データ定義(CCTS CCT)を拡張して定義されている。
UBL Unqualified Data Types | CCTS CCT Data Types | XML Schema Data Types |
---|---|---|
TextType | TextType | string |
NameType | TextType | string |
IdentifierType | IdentifierType | normalizedString |
CodeType | CodeType | normalizedString |
XML Schema Part 2: Datatypes Second EditionでXMLのデータ型が定義されている。
xsd:stringは、漢字や改行やタブコードなどの制御記号も含むユニコードの文字列。xsd:stringとxsd:normalizedStringの違いは、xsd:normalizedStringは、キャリッジリターン (#xD), ラインフィード (#xA) や タブ (#x9) といった制御記号を含まない文字列であるということ。xsd:normalizedStrigは、空白文字(スペース)を含んでも良い。
CCTS CCT Data Typesの定義内容を次に示す。Open Peppolでは、ここで指定可能な属性の一部を使用している。
Text. Type
A character string (i.e. a finite set of characters) generally in the form of words of a language.
languageID
type=”xsd:language” use=”optional
The identifier of the language used in the content component.
languageLocaleID
type=”xsd:normalizedString” use=”optional”
The identification of the locale of the language.
Identifier. Type
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.
schemeID
type=”xsd:normalizedString” use=”optional”
The identification of the identification scheme.
schemeName
type=”xsd:string” use=”optional”
The name of the identification scheme.
schemeAgencyID
type=”xsd:normalizedString” use=”optional”
The identification of the agency that maintains the identification scheme.
schemeAgencyName
type=”xsd:string” use=”optional”
The name of the agency that maintains the identification scheme.
schemeVersionID
type=”xsd:normalizedString” use=”optional”
The version of the identification scheme.
schemeDataURI
type=”xsd:anyURI” use=”optional”
The Uniform Resource Identifier that identifies where the identification scheme data is located.
schemeURI
type=”xsd:anyURI” use=”optional”
The Uniform Resource Identifier that identifies where the identification scheme is located.
Code. Type
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.
listID
type=”xsd:normalizedString” use=”optional”
The identification of a list of codes.
listAgencyID
type=”xsd:normalizedString” use=”optional”
An agency that maintains one or more lists of codes.
listAgencyName
type=”xsd:string” use=”optional”
The name of the agency that maintains the list of codes.
listName
type=”xsd:string” use=”optional”
The name of a list of codes.
listVersionID
type=”xsd:normalizedString” use=”optional”
The version of the list of codes.
name
type=”xsd:string” use=”optional”
The textual equivalent of the code content component.
languageID
type=”xsd:language” use=”optional”
The identifier of the language used in the code name.
listURI
type=”xsd:anyURI” use=”optional”
he Uniform Resource Identifier that identifies where the code list is located.
listSchemeURI
type=”xsd:anyURI” use=”optional”
The Uniform Resource Identifier that identifies where the code list scheme is located.
Open Peppolが使用しているデータ型
Semantic Data Types | UBL element (cbc) | UBL Data Types |
---|---|---|
Text | cbc:AccountingCost cbc:AllowanceChargeReason cbc:BuyerReference cbc:CompanyLegalForm cbc:CountrySubentity cbc:Description cbc:DocumentDescription cbc:ElectronicMail cbc:Line cbc:Note cbc:PostalZone cbc:TaxExemptionReason cbc:Telephone cbc:Value | TextType |
Text | cbc:AdditionalStreetName cbc:CityName cbc:HolderName cbc:Name cbc:RegistrationName cbc:StreetName | NameType |
Text | cbc:PaymentID cbc:PrimaryAccountNumberID cbc:ProfileID cbc:URI | IdentifierType |
Identifier | cbc:CompanyID cbc:CustomizationID cbc:EndpointID cbc:ID cbc:PaymentMeansID | IdentifierType |
Document Reference | cbc:ID cbc:LineID cbc:SalesOrderID | IdentifierType |
Identifier | cbc:ItemClassificationCode | CodeType |
Code | cbc:ID cbc:InstructionID | IdentifierType |
Code | cbc:AllowanceChargeReasonCode cbc:DescriptionCode cbc:DocumentCurrencyCode cbc:DocumentTypeCode cbc:IdentificationCode cbc:InvoiceTypeCode cbc:PaymentMeansCode cbc:TaxCurrencyCode cbc:TaxExemptionReasonCode | CodeType |
テストデータの検証
漢字も含めた自由な文字列を記載可能なので、IDやコードについて記載内容を制限するルールをスキーマトロンで定義する場合がある。
定義するとき、コードとして使用可能な値を国連コードなどの世界標準で規定されている値の範囲内に制限する場合と正規表現などを指定して文字列のパターンを制限する場合がある。
次のテストデータは、Open Peppolの電子インボイスに漢字などを記入した例。
請求書番号に漢字を使用してもUBL 2.1のスキーマ検証ではエラーとされないことに注意。
<?xml version="1.0" encoding="UTF-8"?><!-- Licensed under European Union Public Licence (EUPL) version 1.2.--> <Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:qdt="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" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 http://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd"> <cbc:CustomizationID>カスタマイゼーションID</cbc:CustomizationID> <cbc:ProfileID>1</cbc:ProfileID> <cbc:ID>請求書1</cbc:ID> <cbc:IssueDate>2013-05-04+09:00</cbc:IssueDate> <cbc:DueDate>2013-05-10+09:00</cbc:DueDate> <cbc:InvoiceTypeCode>インボイス</cbc:InvoiceTypeCode> <cbc:Note>ウェブサイトからのご注文 #ご注文内容</cbc:Note> <cbc:DocumentCurrencyCode>DKK</cbc:DocumentCurrencyCode> <cbc:TaxCurrencyCode>日本円</cbc:TaxCurrencyCode> <cbc:AccountingCost>消耗品科目</cbc:AccountingCost> <cbc:BuyerReference>お得意先科目</cbc:BuyerReference> <cac:InvoicePeriod> <cbc:StartDate>2013-03-10+09:00</cbc:StartDate> <cbc:EndDate>2013-04-10+09:00</cbc:EndDate> </cac:InvoicePeriod> <cac:OrderReference> <cbc:ID>注文番号 012345</cbc:ID> <cbc:SalesOrderID>発注番号 987654</cbc:SalesOrderID> </cac:OrderReference> <cac:BillingReference> <cac:InvoiceDocumentReference> <cbc:ID>注文書 5432</cbc:ID> <cbc:IssueDate>2013-03-10+12:34</cbc:IssueDate> </cac:InvoiceDocumentReference> </cac:BillingReference> <cac:DespatchDocumentReference> <cbc:ID>発送状 45679-32</cbc:ID> </cac:DespatchDocumentReference> <cac:ReceiptDocumentReference> <cbc:ID>検収書 3457</cbc:ID> </cac:ReceiptDocumentReference> <cac:OriginatorDocumentReference> <cbc:ID>製造ロット ASDF-7654</cbc:ID> </cac:OriginatorDocumentReference> <cac:ContractDocumentReference> <cbc:ID>契約書 2013-01-6789</cbc:ID> </cac:ContractDocumentReference> <cac:AdditionalDocumentReference> <cbc:ID>参照文書 LKJ-)('</cbc:ID> <cbc:DocumentDescription>特殊仕様 HTRE-87#</cbc:DocumentDescription> </cac:AdditionalDocumentReference> <cac:AdditionalDocumentReference> <cbc:ID>注文書</cbc:ID> <cbc:DocumentDescription>お客様の注文書</cbc:DocumentDescription> <cac:Attachment> <cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="EHF.pdf">VGVzdGluZyBCYXNlNjQgZW5jb2Rpbmc=</cbc:EmbeddedDocumentBinaryObject> </cac:Attachment> </cac:AdditionalDocumentReference> <cac:ProjectReference> <cbc:ID> プロジェクト NM-'=%-#NT </cbc:ID> </cac:ProjectReference> <cac:AccountingSupplierParty> <cac:Party> <cbc:EndpointID schemeID="ぺポル">〇〇製作所ぺポル登録番号</cbc:EndpointID> <cac:PartyIdentification> <cbc:ID schemeID="JIPDEC">〇〇製作所登録事業者番号</cbc:ID> </cac:PartyIdentification> <cac:PartyName> <cbc:Name>〇〇製作所</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:StreetName>●●通り一丁目</cbc:StreetName> <cbc:AdditionalStreetName>本社ビル</cbc:AdditionalStreetName> <cbc:CityName>××区</cbc:CityName> <cbc:PostalZone>123-4567</cbc:PostalZone> <cbc:CountrySubentity>東京都</cbc:CountrySubentity> <cac:Country> <cbc:IdentificationCode>jP</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID schemeID="国税庁">〇〇製作所登録事業者番号</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>消費税</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>〇〇製作所</cbc:RegistrationName> <cbc:CompanyID>登録番号123</cbc:CompanyID> <cbc:CompanyLegalForm>製造販売</cbc:CompanyLegalForm> </cac:PartyLegalEntity> <cac:Contact> <cbc:Name>営業本部</cbc:Name> <cbc:Telephone>+81-98989898</cbc:Telephone> <cbc:ElectronicMail>Anthon@Selco.nl</cbc:ElectronicMail> </cac:Contact> </cac:Party> </cac:AccountingSupplierParty> <cac:AccountingCustomerParty> <cac:Party> <cbc:EndpointID schemeID="ぺポル">△△△本舗ぺポル登録番号</cbc:EndpointID> <cac:PartyIdentification> <cbc:ID schemeID="TDB">△△△本舗登録事業者番号</cbc:ID> </cac:PartyIdentification> <cac:PartyName> <cbc:Name>△△△本舗</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:StreetName>●●通り, ◇◇◇ビル 1</cbc:StreetName> <cbc:AdditionalStreetName>◇◇◇◇</cbc:AdditionalStreetName> <cbc:CityName>〇〇</cbc:CityName> <cbc:PostalZone>101</cbc:PostalZone> <cbc:CountrySubentity>東京都</cbc:CountrySubentity> <cac:Country> <cbc:IdentificationCode>JP</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID schemeID="国税庁">△△△本舗登録事業者番号</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>消費税</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>株式会社△△△本舗</cbc:RegistrationName> <cbc:CompanyID>株式会社△△△本舗識別番号</cbc:CompanyID> </cac:PartyLegalEntity> <cac:Contact> <cbc:Name>John Hansen</cbc:Name> <cbc:Telephone>+4598989898</cbc:Telephone> <cbc:ElectronicMail>john.hansen@buyercompany.dk</cbc:ElectronicMail> </cac:Contact> </cac:Party> </cac:AccountingCustomerParty> <cac:Delivery> <cbc:ActualDeliveryDate>2013-04-15</cbc:ActualDeliveryDate> <cac:DeliveryLocation> <cbc:ID>5790000436068</cbc:ID> <cac:Address> <cbc:StreetName>配送先の番地</cbc:StreetName> <cbc:AdditionalStreetName>検収場所</cbc:AdditionalStreetName> <cbc:CityName>配送先の市</cbc:CityName> <cbc:PostalZone>9000</cbc:PostalZone> <cbc:CountrySubentity>東京都</cbc:CountrySubentity> <cac:Country> <cbc:IdentificationCode>JP</cbc:IdentificationCode> </cac:Country> </cac:Address> </cac:DeliveryLocation> </cac:Delivery> <cac:PaymentMeans> <cbc:PaymentMeansCode>49</cbc:PaymentMeansCode> <cbc:InstructionNote>半額前払い</cbc:InstructionNote> <cbc:PaymentID>Payref1</cbc:PaymentID> <cac:PaymentMandate> <cbc:ID>123456</cbc:ID> <cac:PayerFinancialAccount> <cbc:ID>〇〇製作所口座番号</cbc:ID> </cac:PayerFinancialAccount> </cac:PaymentMandate> </cac:PaymentMeans> <cac:PaymentTerms> <cbc:Note>半額前払い残金翌月末</cbc:Note> </cac:PaymentTerms> <cac:AllowanceCharge> <cbc:ChargeIndicator>0</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>100</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Loyal customer</cbc:AllowanceChargeReason> <cbc:MultiplierFactorNumeric>5</cbc:MultiplierFactorNumeric> <cbc:Amount currencyID="DKK">75.00</cbc:Amount> <cbc:BaseAmount currencyID="DKK">1500.00</cbc:BaseAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:AllowanceCharge> <cac:AllowanceCharge> <cbc:ChargeIndicator>true</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Packaging</cbc:AllowanceChargeReason> <cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric> <cbc:Amount currencyID="DKK">150.00</cbc:Amount> <cbc:BaseAmount currencyID="DKK">1500.00</cbc:BaseAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:AllowanceCharge> <cac:TaxTotal> <cbc:TaxAmount currencyID="DKK">357.50</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="DKK">1575.00</cbc:TaxableAmount> <cbc:TaxAmount currencyID="DKK">157.50</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>10</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="DKK">2500.00</cbc:TaxableAmount> <cbc:TaxAmount currencyID="DKK">200.00</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>AA</cbc:ID> <cbc:Percent>8</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> <cac:TaxTotal> <cbc:TaxAmount currencyID="日本円">6190</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxAmount currencyID="日本円">2727</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>10</cbc:Percent> <cac:TaxScheme> <cbc:ID>消費税</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> <cac:TaxSubtotal> <cbc:TaxAmount currencyID="日本円">3463</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>軽減税率</cbc:ID> <cbc:Percent>8</cbc:Percent> <cac:TaxScheme> <cbc:ID>消費税</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> <cac:LegalMonetaryTotal> <cbc:LineExtensionAmount currencyID="DKK">4000.00</cbc:LineExtensionAmount> <cbc:TaxExclusiveAmount currencyID="DKK">4075.00</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID="DKK">4432.50</cbc:TaxInclusiveAmount> <cbc:AllowanceTotalAmount currencyID="DKK">75.00</cbc:AllowanceTotalAmount> <cbc:ChargeTotalAmount currencyID="DKK">150.00</cbc:ChargeTotalAmount> <cbc:PrepaidAmount currencyID="DKK">2000.00</cbc:PrepaidAmount> <cbc:PayableAmount currencyID="DKK">2432.50</cbc:PayableAmount> </cac:LegalMonetaryTotal> <cac:InvoiceLine> <cbc:ID>1</cbc:ID> <cbc:Note>納品1</cbc:Note> <cbc:InvoicedQuantity unitCode="EA">1000</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID="DKK">1000.00</cbc:LineExtensionAmount> <cbc:AccountingCost>ACC7654</cbc:AccountingCost> <cac:InvoicePeriod> <cbc:StartDate>2013-03-10</cbc:StartDate> <cbc:EndDate>2013-04-10</cbc:EndDate> </cac:InvoicePeriod> <cac:OrderLineReference> <cbc:LineID>明細行1</cbc:LineID> </cac:OrderLineReference> <cac:DocumentReference> <cbc:ID>納品書 2013-04-15 </cbc:ID> <cbc:DocumentTypeCode>380</cbc:DocumentTypeCode> </cac:DocumentReference> <cac:Item> <cbc:Description>納品書 2013-04-15 用紙, 2mm</cbc:Description> <cbc:Name>用紙, 2mm</cbc:Name> <cac:BuyersItemIdentification> <cbc:ID>△△△本舗BUY123</cbc:ID> </cac:BuyersItemIdentification> <cac:SellersItemIdentification> <cbc:ID>〇〇製作所JB007</cbc:ID> </cac:SellersItemIdentification> <cac:StandardItemIdentification> <cbc:ID schemeID="0088">1234567890128</cbc:ID> </cac:StandardItemIdentification> <cac:OriginCountry> <cbc:IdentificationCode>JP</cbc:IdentificationCode> </cac:OriginCountry> <cac:CommodityClassification> <cbc:ItemClassificationCode listID="ZZZ">12344321</cbc:ItemClassificationCode> </cac:CommodityClassification> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> <cac:AdditionalItemProperty> <cbc:Name>厚さ</cbc:Name> <cbc:Value>2 mm</cbc:Value> </cac:AdditionalItemProperty> </cac:Item> <cac:Price> <cbc:PriceAmount currencyID="DKK">1.00</cbc:PriceAmount> <cbc:BaseQuantity unitCode="EA">1</cbc:BaseQuantity> <cac:AllowanceCharge> <cbc:ChargeIndicator>0</cbc:ChargeIndicator> <cbc:Amount currencyID="DKK">0.10</cbc:Amount> <cbc:BaseAmount currencyID="DKK">1.10</cbc:BaseAmount> </cac:AllowanceCharge> </cac:Price> </cac:InvoiceLine> <cac:InvoiceLine> <cbc:ID>2</cbc:ID> <cbc:Note>納品2</cbc:Note> <cbc:InvoicedQuantity unitCode="個">100</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID="DKK">500.00</cbc:LineExtensionAmount> <cbc:AccountingCost>ACC7654</cbc:AccountingCost> <cac:InvoicePeriod> <cbc:StartDate>2013-03-10</cbc:StartDate> <cbc:EndDate>2013-04-10</cbc:EndDate> </cac:InvoicePeriod> <cac:OrderLineReference> <cbc:LineID>2</cbc:LineID> </cac:OrderLineReference> <cac:DocumentReference> <cbc:ID>納品2</cbc:ID> <cbc:DocumentTypeCode>130</cbc:DocumentTypeCode> </cac:DocumentReference> <cac:Item> <cbc:Description>万年筆, 黒色, モデル1</cbc:Description> <cbc:Name>万年筆</cbc:Name> <cac:SellersItemIdentification> <cbc:ID>JB008</cbc:ID> </cac:SellersItemIdentification> <cac:OriginCountry> <cbc:IdentificationCode>JP</cbc:IdentificationCode> </cac:OriginCountry> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> </cac:Item> <cac:Price> <cbc:PriceAmount currencyID="DKK">5.00</cbc:PriceAmount> </cac:Price> </cac:InvoiceLine> <cac:InvoiceLine> <cbc:ID>3</cbc:ID> <cbc:InvoicedQuantity unitCode="EA">500</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID="DKK">2500.00</cbc:LineExtensionAmount> <cac:Item> <cbc:Name>菓子</cbc:Name> <cac:SellersItemIdentification> <cbc:ID>JB009</cbc:ID> </cac:SellersItemIdentification> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>12</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> </cac:Item> <cac:Price> <cbc:PriceAmount currencyID="DKK">5.00</cbc:PriceAmount> </cac:Price> </cac:InvoiceLine> </Invoice>
このデータをスキーマトロンで検証すると次のようなメッセージが発行される。不正な値が記載されている箇所を検出できている箇所と検出できていない箇所がある。
どのような確認範囲が妥当か今後検討が予定されている。
<?xml version="1.0" encoding="UTF-16"?> <log> <file done="true" is_schema="false" path="D:\Users\pontsoleil\Documents\GitHub\EIPA\JP-PINT-BIS\Message examples\ubl-tc434-example5_ja.xml" schema_dtd_ref="false" time="11/17/21 10:38:16" valid="false"> <general>Checked against D:\Users\pontsoleil\Documents\GitHub\EIPA\JP-PINT-BIS\billing-1.0-resources-dev 3\invoice-1.0\schematron\PINT-UBL-validation-preprocessed.sch</general> <results> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-01]-The document type code MUST be coded by the invoice and credit note related code lists of UNTDID 1001.]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceTypeCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-05]-Tax currency code MUST be coded using ISO code list 4217 alpha-3]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:TaxCurrencyCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-25]-Endpoint identifier scheme identifier MUST belong to the CEF EAS code list]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:EndpointID[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-10]-Any identifier identification scheme MUST be coded using one of the ISO 6523 ICD list.]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PartyIdentification[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:ID[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-14]-Country codes in an invoice MUST be coded using ISO code list 3166-1]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PostalAddress[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Country[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:IdentificationCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-25]-Endpoint identifier scheme identifier MUST belong to the CEF EAS code list]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingCustomerParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:EndpointID[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-10]-Any identifier identification scheme MUST be coded using one of the ISO 6523 ICD list.]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingCustomerParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:PartyIdentification[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:ID[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-14]-Country codes in an invoice MUST be coded using ISO code list 3166-1]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:Delivery[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:DeliveryLocation[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Address[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Country[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:IdentificationCode[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-03]-currencyID MUST be coded using ISO code list 4217 alpha-3.]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:TaxTotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:TaxAmount[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-03]-currencyID MUST be coded using ISO code list 4217 alpha-3.]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:TaxTotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:TaxSubtotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:TaxAmount[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-03]-currencyID MUST be coded using ISO code list 4217 alpha-3.]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:TaxTotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:TaxSubtotal[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:TaxAmount[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> <result type="error"> <position col="0" line="0"/> <description><![CDATA[[ibr-cl-23]-Unit code MUST be coded according to the UN/ECE Recommendation 20 with Rec 21 extension]]></description> <xpath>/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:InvoiceLine[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][2]/*:InvoicedQuantity[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]</xpath> </result> </results> </file> </log>
例えば、適格請求書発行事業者登録番号のチェックは、次の関数を使用して試行しています。
matches(normalize-space(cac:Party/cac:PartyTaxScheme/cbc:CompanyID),‘^T[0-9]{13}$’)
ここで、
^T[0-9]{13}$
は、“T”で始まり、数字が13桁かを確認するための正規表現です。
小文字の”t”もOKとする場合は、
^[Tt][0-9]{13}$
T1-2345-6789-0123だと、
^[Tt][0-9]{4}-[0-9]{4}-[0-9]{4}$
が検証用の正規表現です。