UBL文档中的customizationID要放什么以及从哪里获取这些信息

问题描述 投票:0回答:1

我正在尝试根据 this XSD filethis schematron 生成发票 UBL XML 文件。一旦生成,我将在here验证它。

因此,根据 schematron,我的 XML 文件中必须有一个 CustomizationID :

<assert id="BR-01" flag="fatal" test="normalize-space(cbc:CustomizationID) != ''">[BR-01]-An Invoice shall have a Specification identifier (BT-24).   </assert>

所以我试图找到 CustomizationID 中需要什么样的值,所以我发现 here 默认值是

urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0
,所以即使认为它可能不是 always 是正确的值,它应该 至少足以验证UBL文档,我错了吗?

但是,如果我将此值放入 XML 文件中并尝试验证它,则会出现一个我不明白的错误。

这是我的 XML 文件:

<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:ccts="urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-2" xmlns:stat="urn:oasis:names:specification:ubl:schema:xsd:DocumentStatusCode-1.0" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:udt="urn:un:unece:uncefact:data:draft:UnqualifiedDataTypesSchemaModule:2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
    <cbc:ID>A00095678</cbc:ID>
    <cbc:IssueDate>2005-06-21</cbc:IssueDate>
    <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>
    <cbc:InvoiceTypeCode>SalesInvoice</cbc:InvoiceTypeCode>
    <cac:AccountingSupplierParty>
    </cac:AccountingSupplierParty>
    <cac:AccountingCustomerParty>
    </cac:AccountingCustomerParty>
    <cac:LegalMonetaryTotal>
        <cbc:PayableAmount currencyID="GBP">107.50</cbc:PayableAmount>
    </cac:LegalMonetaryTotal>
    <cac:InvoiceLine>
        <cbc:ID>A</cbc:ID>
        <cbc:LineExtensionAmount currencyID="GBP">100.00</cbc:LineExtensionAmount>
        <cac:Item>
        </cac:Item>
    </cac:InvoiceLine>
</Invoice>

当我尝试验证我的 XML 文件时,出现此错误:

cvc-complex-type.2.4.a:发现无效内容开头 元素 '{“urn:oasis:名称:规范:ubl:schema:xsd:CommonBasicComponents-2”:CustomizationID}'。 之一 '{“urn:oasis:名称:规范:ubl:schema:xsd:CommonBasicComponents-2”:IssueTime, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:DueDate, “urn:oasis:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:InvoiceTypeCode, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:注意, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:TaxPointDate, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:DocumentCurrencyCode, “瓮:绿洲:名称:规范:ubl:模式:xsd:CommonBasicComponents-2”:TaxCurrencyCode, “urn:oasis:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:PricingCurrencyCode, “urn:oasis:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:PaymentCurrencyCode, “urn:oasis:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:PaymentAlternativeCurrencyCode, “urn:oasis:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:AccountingCostCode, “瓮:oasis:名称:规范:ubl:模式:xsd:CommonBasicComponents-2”:AccountingCost, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:LineCountNumeric, “瓮:oasis:名称:规范:ubl:架构:xsd:CommonBasicComponents-2”:BuyerReference, “urn:oasis:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:InvoicePeriod, “urn:oasis:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:OrderReference, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:BillingReference, “urn:oasis:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:DespatchDocumentReference, “urn:oasis:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:ReceiptDocumentReference, “瓮:oasis:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:StatementDocumentReference, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:OriginatorDocumentReference, “瓮:绿洲:名称:规范:ubl:模式:xsd:CommonAggregateComponents-2”:ContractDocumentReference, “urn:oasis:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:AdditionalDocumentReference, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:ProjectReference, “瓮:绿洲:名称:规范:ubl:模式:xsd:CommonAggregateComponents-2”:签名, “瓮:绿洲:名称:规范:ubl:架构:xsd:CommonAggregateComponents-2”:AccountingSupplierParty}' 预计。

我不明白该错误以及如何修复它。首先,如果它是默认值,它为什么不是有效内容?其次,为什么它需要任何其他字段?有什么想法吗?

xml xsd schematron ubl
1个回答
0
投票

基本上,它告诉您当时并不期望 CustomizationID,但如果它列出的其他元素是一个(因此除了最后一个 AccountingSupplierParty 之外,它们都必须是可选的),所以如果您删除 CustomizationID,则下一个元素将是 InvoiceTypeCode 并且它将验证。

© www.soinside.com 2019 - 2024. All rights reserved.