OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

tag-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: Comment on Test Assertion Markup Language


Following up on this, although I hope to produce
better artefacts a bit later (with some help with the
XPaths and TAML) I'll send a more intact, though
incomplete, set of test assertions which go some
way to defining an example subset of UBL (loosely
based on the incomplete UBL 2 SBS for an invoice).

I'll attach a zip file but copy TAs inline below too in
case there are any problems sending attachments.
Note that it starts with mandatory TAs for elements
mandatory in the standard UBL 2 invoice, then it
has 'permitted' parts of the subset, then finally TAs
with negated predicates for elements outside the subset
with 'preferred' prescription (to say it is preferred that
those particular elements and attributes are not in the
invoice).

I anticipate this set of test assertions changing/being
corrected but I hope it will inspire some similar use to
support definitions of subsets like this.

Best regards

Steve
---
Stephen D Green

TAML test assertions defining part of a UBL subset:


<?xml version="1.0" encoding="UTF-8"?>
<taml:testAssertionSet xmlns:taml="http://docs.oasis-open.org/ns/tag/taml-201002/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://docs.oasis-open.org/ns/tag/taml-201002/ http://docs.oasis-open.org/tag/taml/v1.0/cd01/testAssertionMarkupLanguage-v1-cd-01.xsd"
    id="ubl-ta-subset-example-draft-0-1"
    lg="en-us"
    date="2010-03-21"
    schemaVersionId="1.0">
    <taml:testAssertionDocumentHeader>
        <taml:common>
            <taml:sourceDocument version="0.1" revision="2">Partial, In-Progress UBL 2 Invoice Example Subset (Based on incomplete UBL 2.0 Small Business subset)</taml:sourceDocument>
            <taml:authors>Stephen D Green</taml:authors>
            <taml:location>.</taml:location>
            <taml:namespaces xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:in="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
                <taml:namespace>
                    <taml:prefix>#default</taml:prefix>
                    <taml:uri>urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</taml:uri>
                </taml:namespace>
                <taml:namespace>
                    <taml:prefix>in</taml:prefix>
                    <taml:uri>urn:oasis:names:specification:ubl:schema:xsd:Invoice-2</taml:uri>
                </taml:namespace>
                <taml:namespace>
                    <taml:prefix>ext</taml:prefix>
                    <taml:uri>urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2</taml:uri>
                </taml:namespace>
                <taml:namespace>
                    <taml:prefix>cac</taml:prefix>
                    <taml:uri>urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2</taml:uri>
                </taml:namespace>
                <taml:namespace>
                    <taml:prefix>cbc</taml:prefix>
                    <taml:uri>urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2</taml:uri>
                </taml:namespace>
            </taml:namespaces>
        </taml:common>
    </taml:testAssertionDocumentHeader>
    <taml:shared>
        <taml:tag name="VersionAdd">2.0</taml:tag>
    </taml:shared>
    <!-- document standard -->
    <taml:testAssertion id="INV1" name="Invoice1" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice) ge 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV2" name="Invoice2" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:ID) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV3" name="Invoice3" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:IssueDate) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV3" name="Invoice3" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cac:AccountingSupplierParty) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV4" name="Invoice4" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cac:AccountingCustomerParty) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV5" name="Invoice5" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cac:LegalMonetaryTotal) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV6" name="Invoice6" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cac:LegalMonetaryTotal/cbc:PayableAmount) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV7" name="Invoice7" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cac:LegalMonetaryTotal/cbc:PayableAmount/@currencyID) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INV8" name="Invoice8" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cac:InvoiceLine) ge 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INVL1" name="InvoiceLine1" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document-line" idscheme="'document-line'">/in:Invoice/cac:InvoiceLine</taml:target>
        <taml:predicate>count(cbc:ID) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INVL2" name="InvoiceLine2" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document-line" idscheme="'document-line'">/in:Invoice/cac:InvoiceLine</taml:target>
        <taml:predicate>count(cac:LineExtensionAmount) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INVL3" name="InvoiceLine3" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document-line" idscheme="'document-line'">/in:Invoice/cac:InvoiceLine</taml:target>
        <taml:predicate>count(cac:LineExtensionAmount/@currencyID) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <taml:testAssertion id="INVL4" name="InvoiceLine4" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document-line" idscheme="'document-line'">/in:Invoice/cac:InvoiceLine</taml:target>
        <taml:predicate>count(cac:Item) ge 1</taml:predicate>
        <taml:prescription level="mandatory"/>
        <taml:report label="failed" message="Not a standard UBL 2 invoice">The file does not contain a standard UBL 2 invoice.</taml:report>
    </taml:testAssertion>
    <!-- ... -->
    <!-- subset -->
    <taml:testAssertion id="INVSUB1" name="InvoiceSubset1" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/ext:UBLExtensions) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB2" name="InvoiceSubset2" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="documentextension" idscheme="'documentextension'">/</taml:target>
        <taml:prerequisite>count(//in:Invoice/ext:UBLExtensions) eq 1</taml:prerequisite>
        <taml:predicate>count(//in:Invoice/ext:UBLExtensions/ext:UBLExtension) ge 1</taml:predicate>
        <taml:prescription level="mandatory"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB3" name="InvoiceSubset3" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="documentextension" idscheme="'documentextension'">/</taml:target>
        <taml:prerequisite>count(//in:Invoice/ext:UBLExtensions) eq 1</taml:prerequisite>
        <taml:predicate>count(//in:Invoice/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent) ge 1</taml:predicate>
        <taml:prescription level="mandatory"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB4" name="InvoiceSubset4" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:UBLVersionID) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB5" name="InvoiceSubset5" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:CustomizationID) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB6" name="InvoiceSubset6" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:ProfileID) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB7" name="InvoiceSubset7" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:CopyIndicator) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB8" name="InvoiceSubset8" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:UUID) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB9" name="InvoiceSubset9" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:InvoiceTypeCode) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB10" name="InvoiceSubset10" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:Note) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB11" name="InvoiceSubset11" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cbc:TaxPointDate) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB12" name="InvoiceSubset12" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>count(//in:Invoice/cac:OrderReference) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB13" name="InvoiceSubset13" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="OrderReference" idscheme="'OrderReference'">/in:Invoice/cac:OrderReference</taml:target>
        <taml:predicate>count(//in:Invoice/cac:OrderReference/cbc:ID) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB14" name="InvoiceSubset14" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="OrderReference" idscheme="'OrderReference'">/in:Invoice/cac:OrderReference</taml:target>
        <taml:prerequisite>count(//in:Invoice/cac:OrderReference) eq 1</taml:prerequisite>
        <taml:predicate>count(//in:Invoice/cac:OrderReference/cbc:ID) eq 1</taml:predicate>
        <taml:prescription level="mandatory"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB15" name="InvoiceSubset15" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="OrderReference" idscheme="'OrderReference'">/in:Invoice/cac:OrderReference</taml:target>
        <taml:predicate>count(//in:Invoice/cac:OrderReference/cbc:SalesOrderID) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB16" name="InvoiceSubset16" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="OrderReference" idscheme="'OrderReference'">/in:Invoice/cac:OrderReference</taml:target>
        <taml:predicate>count(//in:Invoice/cac:OrderReference/cbc:UUID) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVSUB17" name="InvoiceSubset17" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="OrderReference" idscheme="'OrderReference'">/in:Invoice/cac:OrderReference</taml:target>
        <taml:predicate>count(//in:Invoice/cac:OrderReference/cbc:IssueDate) eq 1</taml:predicate>
        <taml:prescription level="permitted"/>
    </taml:testAssertion>
    <!-- ... -->
    <!-- non subset -->
    <taml:testAssertion id="INVNS1" name="InvoiceNonSubset1" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:IssueTime) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS2" name="InvoiceNonSubset2" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:DocumentCurrencyCode) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS3" name="InvoiceNonSubset3" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:TaxCurrencyCode) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS4" name="InvoiceNonSubset4" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:PricingCurrencyCode) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS5" name="InvoiceNonSubset5" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:PaymentCurrencyCode) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS6" name="InvoiceNonSubset6" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:PaymentAlternativeCurrencyCode) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS7" name="InvoiceNonSubset7" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:AccountingCostCode) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS8" name="InvoiceNonSubset8" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:AccountingCost) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS9" name="InvoiceNonSubset9" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:LineCountNumeric) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS10" name="InvoiceNonSubset10" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:InvoicePeriod) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS11" name="InvoiceNonSubset11" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:BillingReference) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS12" name="InvoiceNonSubset12" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:DespatchDocumentReference) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS13" name="InvoiceNonSubset13" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:ReceiptDocumentReference) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS14" name="InvoiceNonSubset14" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:OriginatorDocumentReference) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS15" name="InvoiceNonSubset15" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:ContractDocumentReference) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS16" name="InvoiceNonSubset16" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:AdditionalDocumentReference) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <taml:testAssertion id="INVNS17" name="InvoiceNonSubset17" enable="true">
        <taml:normativeSource>.</taml:normativeSource>
        <taml:target type="document" idscheme="'document'">/</taml:target>
        <taml:predicate>not(count(//in:Invoice/cbc:Signature) eq 1)</taml:predicate>
        <taml:prescription level="preferred"/>
    </taml:testAssertion>
    <!-- ... -->
</taml:testAssertionSet>




On 21 March 2010 22:43, Stephen Green <stephengreenubl@gmail.com> wrote:
> Congratulations to TAG TC on the set of three committee drafts
> commencing public review stage.
>
> I just wish to make a further comment on the ways test assertions
> such as those marked up with the TAG TC Test Assertion Markup
> Language (TAML) can be used to support customisations of a
> standard like Universal Business Language: It occurrs to me that
> besides its currently documented use for UBL custom calculation
> models
> http://docs.oasis-open.org/ubl/guidelines/UBL2-Customization1.0cs01.html
> it might also be used to formally define a UBL subset (like the Small
> Business Subset) by use of its potentials to 1) list XPath statements
> and 2) denote these as mandatory, permitted or preferred.
>
> I put together a quick example to show this concept (not proof of concept
> as yet as it is not yet properly tested, eg with tools such as TAMELizer):
>
> the set of test assertions could start with ones which show parts of
> the document made mandatory by the UBL standard itself
>
> ...
>    <taml:testAssertion id="INV1" name="Invoice1" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice) ge 1</taml:predicate>
>        <taml:prescription level="mandatory"/>
>        <taml:report label="failed" message="Not a standard UBL 2
> invoice">The file does not contain a standard UBL 2
> invoice.</taml:report>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV2" name="Invoice2" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:ID) eq 1</taml:predicate>
>        <taml:prescription level="mandatory"/>
>        <taml:report label="failed" message="Not a standard UBL 2
> invoice">The file does not contain a standard UBL 2
> invoice.</taml:report>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV3" name="Invoice3" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:IssueDate) eq 1</taml:predicate>
>        <taml:prescription level="mandatory"/>
>        <taml:report label="failed" message="Not a standard UBL 2
> invoice">The file does not contain a standard UBL 2
> invoice.</taml:report>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV3" name="Invoice3" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cac:AccountingSupplierParty)
> eq 1</taml:predicate>
>        <taml:prescription level="mandatory"/>
>        <taml:report label="failed" message="Not a standard UBL 2
> invoice">The file does not contain a standard UBL 2
> invoice.</taml:report>
>    </taml:testAssertion>
> ...
> etc
> ...
>
> and it could then proceed to list the optional elements and attributes
> which are part of the subset
>
> ...
>
>    <taml:testAssertion id="INV9" name="Invoice9" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:CopyIndicator) eq
> 1</taml:predicate>
>        <taml:prescription level="permitted"/>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV9" name="Invoice9" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:CustomizationID) eq
> 1</taml:predicate>
>        <taml:prescription level="permitted"/>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV10" name="Invoice10" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:ProfileID) eq 1</taml:predicate>
>        <taml:prescription level="permitted"/>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV11" name="Invoice11" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:CopyIndicator) eq
> 1</taml:predicate>
>        <taml:prescription level="permitted"/>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV12" name="Invoice12" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:UUID) eq 1</taml:predicate>
>        <taml:prescription level="permitted"/>
>    </taml:testAssertion>
>    <taml:testAssertion id="INV13" name="Invoice13" enable="true">
>        <taml:normativeSource>.</taml:normativeSource>
>        <taml:target type="document" idscheme="'document'">/</taml:target>
>        <taml:predicate>count(//in:Invoice/cbc:TaxPointDate) eq
> 1</taml:predicate>
>        <taml:prescription level="permitted"/>
>    </taml:testAssertion>
> ...
> etc
> ...
>
> There would be a design / requirements choice as to whether to proceed
> to list elements and attributes of UBL which are not a part of the subset.
> These could be denoted in various ways regarding the 'prescription' level:
> they might be ideally 'permitted' but not 'preferred' and there might be ways
> to represent this. Bearing mind there might be a lot of these elements outside
> of the subset but within the UBL standard but brevity might not be an
> issue if the subset test assertions are generated.
>
> All the best with the TAG public review.
>
> Best regards
>
> Steve
> ---
> Stephen D Green
>

test.zip



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]