如果UBL中的miniOccurs =“0”,如何知道哪个元素是必需的

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

这是我的 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>
    <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>

我将由于 minOccurs="1" 而需要的唯一元素放入 UBL.xsd 文件中。

当我尝试在此网站

上验证我的 XML 时
[BR-01]-An Invoice shall have a Specification identifier (BT-24).
[BR-04]-An Invoice shall have an Invoice type code (BT-3).
[BR-05]-An Invoice shall have an Invoice currency code (BT-5).
[BR-06]-An Invoice shall contain the Seller name (BT-27).
[BR-07]-An Invoice shall contain the Buyer name (BT-44).
[BR-08]-An Invoice shall contain the Seller postal address.
[BR-10]-An Invoice shall contain the Buyer postal address (BG-8).
[BR-CO-18]-An Invoice shall at least have one VAT breakdown group (BG-23).

我明白错误的含义,我的问题更多: UBL.xsd 文件说这些元素是强制性的是什么?我将必须生成有关其他 .xsd 文件的文件,并且我想了解哪些元素是必需的。

xml xsd ubl
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.