Code list task group final report (draft 1)

$Date: 2003/09/11 14:32:29 $(UTC)


Table of Contents

1. Overview
2. Scope
3. Validation of authored content regarding code lists
3.1. Mechanical approach to validation
3.2. Example illustration of the approach to validation
4. The supply of supplemental information in a code list adjunct file
5. Code list catalogue

1.  Overview

This is the final report of the UBL code list task group addressing the issues described in the minutes of the 2003-08-28 meeting of the code list task group:

This document is not meant to be the candidate wording for any NDR rules or recommendations or formal UBL documentation to be supplied to end users; this is only meant for communicating the conclusions of the task group. It will be up to each of NDRSC, FPSC and LCSC to accept and then act on these results.

The active members of and contributors to this code list task group were (alphabetically) Jon Bosak, Chee-Kai Chin, Tony Coates, Steve Green, G. Ken Holman (chair) and Lisa Seaburg. Many thanks to Tim McGrath and Gunther Stuhec for their contributions.

In conjunction with this report is a ZIP file named code-proposal-20030911.zip containing the experimental illustrative results of validation and the first draft of the catalogue produced by this task group.

2.  Scope

The scope of this work is in two areas (primarily in the first of these):

  • the validation of authored values used in code-list-based data type content of a UBL instance

  • the supply of supplemental information of interest to downstream processing applications for purposes such as the presentation and acceptance of the information to and from a human with appropriate translations

3.  Validation of authored content regarding code lists

The code list task group identified and detailed four validation perspectives, termed "code list definitions" for the values found in instance content of the type of a given code list, summarized as:

  • "standard" constraints supplied by UBL and expected to be used by users

  • "placebo" constraints delivered "out-of-the-box" by UBL but only providing rudimentary validation of the structure of the contents and not the specific value of the contents

  • "stock" constraints delivered by UBL and available to the user to override "placebo" constraints

  • "private" constraints created by the user and used to override either "standard" or "placebo" constraints

The code list task group has created a catalogue of all code lists in all UBL document models, including among a host of other pieces of information the following fields:

  • a classification of each code list as requiring either a "standard" or a "placebo" set of constraints to be developed by LCSC and supplied in the final package as the out-of-the-box delivered collection of valid values

  • a classification of each "placebo" code list as needing a "stock" set of constraints to be developed by LCSC and supplied in the final package as an alternative collection of valid values

  • an informative namespace prefix for the data type of the code list, used to ensure consistent documentation

    • namespace prefixes are never normative

    • this value is a key field in the catalogue indexing the same values found in the model spreadsheets

The "in-use" definition for a code list is that definition utilized during the validation process. Only values for standard definitions of code lists are validated for their content when UBL is run out-of-the-box. All other code lists are validated using the placebo definition merely as having a tokenized value, and this value is not checked against any further constraints.

A number of code lists have been identified as suitable for a stock definition of meaningful values that an end user may wish to use, but is not obliged to use when UBL is run out-of-the-box. Alternatively an end user may wish to create a "private-use" code list definition, in a separate file from the UBL definitions, containing the collection of values different than any collection .

The end user is obliged to go through a mechanical task of engaging either a stock or private-use code list definition, and after any such engagement can revert to the out-of-the-box configuration by engaging the original standard or placebo code list definition.

3.1.  Mechanical approach to validation

An entirely satisfactory end-user mechanism for code list definition engagement was not determined. For the time being the only viable configuration mechanism uses a brute-force file copy command, though this does have the benefit of not needing the user to go into any particular delivered file and do any editing of the file.

A highly modular approach is, therefore, proposed for the mechanical implementation of the data typing of the code list:

  • the delivered set of UBL code list validation constraints works out-of-the-box

    • the contents of those code lists with standard definitions are validated for specific values

    • the contents of all other code lists are validated only as being tokenized values through the placebo definitions

  • the delivered Core Component Types schema fragment is unchanged and provides a base code data type from which all specific code data types are derived

    • this base data time is named cct:CodeType

    • all code list data types have the local name DerivedCodeType

    • each code list is distinguished by a normative namespace URI calculated from the dictionary entry name for the code list

    • a conventional namespace prefix has been proposed for every namespace in UBL, including all of the namespaces used for the code lists

    • the code list data type uses the common local name in its respective distinguishing namespace URI using its namespace prefix, as in the document status code status:DerivedCodeType

  • all code lists are delivered referencing the relative URL of the "in-use" definition file

    • delivered as either the standard definition or the placebo definition as applicable to each list

  • end user reconfiguration of a UBL code lists is accomplished by the user replacing the in-use definition file with the desired definition file:

    • any utility can be used for copying the desired files over top of delivered files

    • none of the delivered files need to be edited by the user, only copied and then only if desired

  • copies of the original delivered set of standard and placebo definitions still exist so that users can restore their configuration to the UBL out-of-the-box configuration

Note that this approach will greatly increase the number of files in the deliverable, but it won't change the complexity of the validation task from the user's perspective.

The following in ASCII art is the importation hierarchy of the schema fragments for a typical document type exemplified by the Order Cancellation document model:

    Order-Cancellation.xsd
        |               |
        |               v
        |       UBL-Reusable.xsd
        |          |       |||
        |          |       vvv
        |          |  Each-Code-List.xsd
        |          |   Each-Code-List.xsd
        |          |    Each-Code-List.xsd
        |          |         |||
        v          v         vvv
        Core-Component-Types.xsd

For information and diagnostic purposes, and through the use of fixed attributes, the PSVI will reflect the nature of the code list definition. The attribute def="standard", def="placebo", def="stock", or def="private" will not be present in the instance but will be present in the PSVI presented to an application.

Experimentation attempted to find a more satisfactory configuration method through the use of the XML Catalog http://www.oasis-open.org/committees/entity/spec-2001-08-06.html facility, though the current state of development of tools did not sufficiently support this facility for proper experimentation. It is thought that useful changes for user configuration of code lists could be considered for the future.

3.2.  Example illustration of the approach to validation

A suite of test files has been created to illustrate the mechanics of validation for a single code list data type. Should this approach be approved, these steps will need to be repeated for every code list. Although this test suite was written to run in an MSDOS command line environment, the concepts are not reserved to MSDOS and the concepts expressed in this test can be replicated in any other operating system environment.

This illustration utilizes two validating W3C Schema processors: MSV http://wwws.sun.com/software/xml/developers/multischema/ and Xerces-C http://xml.apache.org/xerces-c/ (not included in the ZIP). The UBL document being validated in a short example of Order Cancellation. The PSVI of the result of W3C Schema processing is exposed through the use of the DOMPrint utility found in the Xerces-C package.

Consider the example of status codes: probably not a good choice for placebo but the smallest sample instance uses it and small is good for examples (go with me on this for this example). A document is of a particular status. As delivered in this example, UBL users can use any status they wish as long as it is a token value because the delivered in-use validation is just a copy of the placebo validation thus it is checking that the value is a W3C Schema token value. UBL delivers a stock set of the two values "Original" and "Copy" as valid status code members. Most users would probably be sufficed by this, so most would copy the stock set over top of the in-use set. One user, however, needs a private set of three values "Original", "Copy" and "Fraudulent", thus necessitating they create a private set of constraints and copy them over top of the in-use file.

The following files (listed alphabetically) are in this illustrative suite:

  • adjunct.bat

    • reconfigures the in-use XSD file of code list constraints by copying the version of the private set of constraints that includes the adjunct URI

    • produces the output-good-private-adjunct.xml file

  • code-catalogue-proposal-20030911.sxc

    • the catalogue of all code lists and their associated information values

  • code-proposal-20030911.xml

    • the DocBook XML source to the task group report HTML file

  • CoreComponentParameters-codelist-strawman-2.xsd

    • unchanged from version 0.81D7 (except for experimental URI strings for namespaces)

  • CoreComponentTypes-codelist-strawman-2.xsd

    • adds a new data type for the <cat:StatusCode> element (and experimental namespace URI)

    • derived from an externally-defined data type in a namespace used solely for that data type

  • output-good-private-adjunct.xml

    • the output of running the test-good-private.xml instance through a W3C Schema processor that exposes the defaulted attributes in the PSVI

  • test-good-private.xml

    • a test instance file utilizing a status code value "Fraudulent" only described in the private set of constraints

  • test-good-stock.xml

    • a test instance file utilizing only a status code value "Original" described in the stock set of constraints

  • test.bat

    • reconfigures the "in-use" XSD file of code list constraints by copying the desired set of constraints

    • tests the resulting "in-use" XSD against both of the test instance files

  • UBL-Codelist-Catalog-Private.xml

    • an untested catalogue-based approach to the configuration mechanism to employ the private set of constraints

  • UBL-Codelist-Catalog-Stock.xml

    • an untested catalogue-based approach to the configuration mechanism to employ the stock set of constraints

  • UBL-CodeList-StatusCode-Placebo-strawman-2.xsd

    • a lax set of constraints checking only that the coded value is a token

    • delivered by UBL and the delivered contents of the "in-use" XSD file

  • UBL-CodeList-StatusCode-Private-Adjunct-strawman-2.xsd

    • a constrained set of values for the status code including "Fraudulent"

    • as if it had been created by a user of UBL

    • includes a defaulted attribute of type URI pointing to a code list adjunct file, the contents of which are arbitrarily defined by the code list creator and documented for those writing stylesheets and processing applications

  • UBL-CodeList-StatusCode-Private-strawman-2.xsd

    • a constrained set of values for the status code including "Fraudulent"

    • as if it had been created by a user of UBL

  • UBL-CodeList-StatusCode-Stock-strawman-2.xsd

    • a constrained set of values expected by the UBL committee to be used by the UBL user for functioning interoperability

  • UBL-CodeList-StatusCode-Use-strawman-2.xsd

    • the set of constraints used by reference by being imported by the Core Component Types schema fragment

    • this file is overwritten in the course of testing different end-user configurations of UBL

  • UBL-OrderCancellation-codelist-strawman-2.xsd

    • the order cancellation document model unmodified

  • UBL-Reusable-codelist-strawman-2.xsd

    • the declaration of the status code element as being the status code data type

  • external/dummy.xsd

    • a dummy code list placebo definition not meant for production use but used to illustrate the production of stock definitions from external definitions

    • in production this file will not be used and each stock definition generation step will utilize the respective placebo definition

  • external/extcode2ubl.xsl

    • an XSLT stylesheet to read an external code list definition and a placebo definition to synthesize a stock definition comprised of all of the enumerations found in the external definition

  • external/makestock.bat

    • the dummy execution for illustrative purposes of extcode2ubl for six UNeDocs code list external definitions

Corresponding to the approach detailed above, note the following regarding various files in this deliverable:

  • the core component types are unchanged from Draft 8 and define the base data type for code lists as CodeType (CoreComponentTypes-codelist-proposal.xsd line 93)

  • the reusable fragment declares <StatusCode> to be of type status:DerivedCodeType (UBL-Reusable-codelist-proposal.xsd line 7494)

  • the reusable fragment imports the definition of status:DerivedCodeType from the in-use file of constraints using the <xsd:import> (UBL-Reusable-codelist-proposal.xsd line 57)

  • the placebo file of constraints derives the status:DerivedCodeType only from the cct:CodeType (UBL-CodeList-StatusCode-Placebo-proposal.xsd line 17)

  • the stock file of constraints declares a set of values UBL believes to be sufficient (UBL-CodeList-StatusCode-Stock-proposal.xsd lines 18-19)

  • the private file of constraints declares that set needed by a particular user and with values not anticipated by UBL (UBL-CodeList-StatusCode-Private-proposal.xsd lines 18-20)

  • the private adjunct file of constraints is the same as the private file of constraints, with the addition of the fixed URL attribute (UBL-CodeList-StatusCode-Private-Adjunct-proposal.xsd line 21)

Running the test.bat file produces the following results using, in turn, each of MSV and Xerces C++ for validation, illustrating the same conclusions made by each of these W3C Schema validators and exposing the PSVI seen by an application:

T:\ubl>rem The delivered code list is the placebo that validates against all token values 

T:\ubl>type test-good-stock.xml 
<?xml version="1.0"?>
<xo:OrderCancellation 
  xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" 
  xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" 
  xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" 
  xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81
                      UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID>X03-20031234-0</cat:ID>
  <cat:StatusCode>Original</cat:StatusCode>
  <cat:IssueDate>2003-02-03</cat:IssueDate>
  <cat:Note>this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode>0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID>20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate>2003-02-02</cat:IssueDate>
    <cat:StatusCode>Original</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID>DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name>Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name>Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>

T:\ubl>type test-good-private.xml 
<?xml version="1.0"?>
<xo:OrderCancellation 
  xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" 
  xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" 
  xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" 
  xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81
                      UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID>X03-20031234-0</cat:ID>
  <cat:StatusCode>Original</cat:StatusCode>
  <cat:IssueDate>2003-02-03</cat:IssueDate>
  <cat:Note>this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode>0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID>20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate>2003-02-02</cat:IssueDate>
    <cat:StatusCode>Fraudulent</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID>DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name>Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name>Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>

T:\ubl>copy UBL-CodeList-StatusCode-Placebo-proposal.xsd UBL-CodeList-StatusCode-Use-proposal.xsd 
        1 file(s) copied.

T:\ubl>type UBL-CodeList-StatusCode-Use-proposal.xsd 
<?xml version="1.0"?>
<!--
  This is the placebo code list definition that validates against all tokens.
-->
<xsd:schema 
        targetNamespace="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:status="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
elementFormDefault="qualified"
attributeFormDefault="qualified">
  <xsd:import namespace="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
    schemaLocation="CoreComponentTypes-codelist-proposal.xsd"/>
  <xsd:element name="StatusCode" type="status:DerivedCodeType"/>
  <xsd:complexType name="DerivedCodeType">
    <xsd:simpleContent>
      <xsd:restriction base="cct:CodeType">
        <xsd:attribute name="def" type="xsd:token" fixed="placebo"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>
</xsd:schema>
T:\ubl>java -jar p:\xml\xml\sun-msv\msvcurr\msv.jar UBL-OrderCancellation-codelist-proposal.xsd test-good-stock.xml 
start parsing a grammar.
validating test-good-stock.xml
the document is valid.

T:\ubl>domprint -n -s -f -wddc=off test-good-stock.xml  2>domprint.err 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><xo:OrderCancellation xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81                       UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID language="en">X03-20031234-0</cat:ID>
  <cat:StatusCode def="placebo" language="en">Original</cat:StatusCode>
  <cat:IssueDate language="en">2003-02-03</cat:IssueDate>
  <cat:Note language="en" languageID="en">this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode language="en">0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID language="en">20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate language="en">2003-02-02</cat:IssueDate>
    <cat:StatusCode def="placebo" language="en">Original</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID language="en">DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>
T:\ubl>if 0 NEQ 0 type domprint.err 

T:\ubl>java -jar p:\xml\xml\sun-msv\msvcurr\msv.jar UBL-OrderCancellation-codelist-proposal.xsd test-good-private.xml 
start parsing a grammar.
validating test-good-private.xml
the document is valid.

T:\ubl>domprint -n -s -f -wddc=off test-good-private.xml  2>domprint.err 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><xo:OrderCancellation xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81                       UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID language="en">X03-20031234-0</cat:ID>
  <cat:StatusCode def="placebo" language="en">Original</cat:StatusCode>
  <cat:IssueDate language="en">2003-02-03</cat:IssueDate>
  <cat:Note language="en" languageID="en">this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode language="en">0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID language="en">20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate language="en">2003-02-02</cat:IssueDate>
    <cat:StatusCode def="placebo" language="en">Fraudulent</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID language="en">DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>
T:\ubl>if 0 NEQ 0 type domprint.err 

T:\ubl>copy UBL-CodeList-StatusCode-Stock-proposal.xsd UBL-CodeList-StatusCode-Use-proposal.xsd 
        1 file(s) copied.

T:\ubl>type UBL-CodeList-StatusCode-Use-proposal.xsd 
<?xml version="1.0"?>
<!--
  This is the placebo code list definition that validates against all tokens.
-->
<xsd:schema 
        targetNamespace="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:status="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
elementFormDefault="qualified"
attributeFormDefault="qualified">
  <xsd:import namespace="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
    schemaLocation="CoreComponentTypes-codelist-proposal.xsd"/>
  <xsd:element name="StatusCode" type="status:DerivedCodeType"/>
  <xsd:complexType name="DerivedCodeType">
    <xsd:simpleContent>
      <xsd:restriction base="cct:CodeType">
        <xsd:enumeration value="Original"/>
        <xsd:enumeration value="Copy"/>
        <xsd:attribute name="def" type="xsd:token" fixed="stock"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>
</xsd:schema>
T:\ubl>java -jar p:\xml\xml\sun-msv\msvcurr\msv.jar UBL-OrderCancellation-codelist-proposal.xsd test-good-stock.xml 
start parsing a grammar.
validating test-good-stock.xml
the document is valid.

T:\ubl>domprint -n -s -f -wddc=off test-good-stock.xml  2>domprint.err 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><xo:OrderCancellation xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81                       UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID language="en">X03-20031234-0</cat:ID>
  <cat:StatusCode def="stock" language="en">Original</cat:StatusCode>
  <cat:IssueDate language="en">2003-02-03</cat:IssueDate>
  <cat:Note language="en" languageID="en">this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode language="en">0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID language="en">20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate language="en">2003-02-02</cat:IssueDate>
    <cat:StatusCode def="stock" language="en">Original</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID language="en">DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>
T:\ubl>if 0 NEQ 0 type domprint.err 

T:\ubl>java -jar p:\xml\xml\sun-msv\msvcurr\msv.jar UBL-OrderCancellation-codelist-proposal.xsd test-good-private.xml 
start parsing a grammar.
validating test-good-private.xml
Error at line:18, column:48 of file:///T:/ubl/test-good-private.xml
  the value is not a member of the enumeration: ("Original"/"Copy")

the document is NOT valid.

T:\ubl>domprint -n -s -f -wddc=off test-good-private.xml  2>domprint.err 

T:\ubl>if 4 NEQ 0 type domprint.err 
Error at file "T:\ubl/test-good-private.xml", line 18, column 48
   Message: Datatype error: Type:InvalidDatatypeValueException, Message:Value 'Fraudulent' is not in enumeration .

T:\ubl>copy UBL-CodeList-StatusCode-Private-proposal.xsd UBL-CodeList-StatusCode-Use-proposal.xsd 
        1 file(s) copied.

T:\ubl>type UBL-CodeList-StatusCode-Use-proposal.xsd 
<?xml version="1.0"?>
<!--
  This is the placebo code list definition that validates against all tokens.
-->
<xsd:schema 
        targetNamespace="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:status="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
elementFormDefault="qualified"
attributeFormDefault="qualified">
  <xsd:import namespace="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
    schemaLocation="CoreComponentTypes-codelist-proposal.xsd"/>
  <xsd:element name="StatusCode" type="status:DerivedCodeType"/>
  <xsd:complexType name="DerivedCodeType">
    <xsd:simpleContent>
      <xsd:restriction base="cct:CodeType">
        <xsd:enumeration value="Original"/>
        <xsd:enumeration value="Copy"/>
        <xsd:enumeration value="Fraudulent"/>
        <xsd:attribute name="def" type="xsd:token" fixed="private"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>
</xsd:schema>
T:\ubl>java -jar p:\xml\xml\sun-msv\msvcurr\msv.jar UBL-OrderCancellation-codelist-proposal.xsd test-good-stock.xml 
start parsing a grammar.
validating test-good-stock.xml
the document is valid.

T:\ubl>domprint -n -s -f -wddc=off test-good-stock.xml  2>domprint.err 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><xo:OrderCancellation xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81                       UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID language="en">X03-20031234-0</cat:ID>
  <cat:StatusCode def="private" language="en">Original</cat:StatusCode>
  <cat:IssueDate language="en">2003-02-03</cat:IssueDate>
  <cat:Note language="en" languageID="en">this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode language="en">0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID language="en">20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate language="en">2003-02-02</cat:IssueDate>
    <cat:StatusCode def="private" language="en">Original</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID language="en">DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>
T:\ubl>if 0 NEQ 0 type domprint.err 

T:\ubl>java -jar p:\xml\xml\sun-msv\msvcurr\msv.jar UBL-OrderCancellation-codelist-proposal.xsd test-good-private.xml 
start parsing a grammar.
validating test-good-private.xml
the document is valid.

T:\ubl>domprint -n -s -f -wddc=off test-good-private.xml  2>domprint.err 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><xo:OrderCancellation xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81                       UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID language="en">X03-20031234-0</cat:ID>
  <cat:StatusCode def="private" language="en">Original</cat:StatusCode>
  <cat:IssueDate language="en">2003-02-03</cat:IssueDate>
  <cat:Note language="en" languageID="en">this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode language="en">0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID language="en">20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate language="en">2003-02-02</cat:IssueDate>
    <cat:StatusCode def="private" language="en">Fraudulent</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID language="en">DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>
T:\ubl>if 0 NEQ 0 type domprint.err 

T:\ubl>domprint -n -s -f -wddc=off test-good-private.xml  2>domprint.err 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><xo:OrderCancellation xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81                       UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID language="en">X03-20031234-0</cat:ID>
  <cat:StatusCode def="private" language="en">Original</cat:StatusCode>
  <cat:IssueDate language="en">2003-02-03</cat:IssueDate>
  <cat:Note language="en" languageID="en">this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode language="en">0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID language="en">20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate language="en">2003-02-02</cat:IssueDate>
    <cat:StatusCode def="private" language="en">Fraudulent</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID language="en">DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>
T:\ubl>if 0 NEQ 0 type domprint.err 

T:\ubl>rem Done! 

Note above how the private instance does not validate against the "stock" set of constraints using either of the W3C Schema processors.

4.  The supply of supplemental information in a code list adjunct file

Some downstream processes may require supplemental information associated with each of the members described in the code list data types. For example, the display string "Etats Unis" for the French-language display of the country code "US".

This proposal suggests a mechanism of naming in a default attribute the file name of supplemental information, where the information in the file is indexed by some means to the individual code list member values. The maintainer of the code list has free rein to describe the supplemental information in any vocabulary desired, though it is incumbent on them to sufficiently describe the vocabulary so that people writing stylesheets or other processes know how to de-reference the strings or other values they might need.

The defaulted attribute is described in the data type definition fragment. None of the placebo data type fragments would point to any supplemental information. The stock data type fragments may or may not be delivered with file names specified for a collection of supplemental files supplied by UBL for these data types.

Using the same mechanisms described above for overriding the data types, a user with a new or custom supplemental file would create a private data type schema expression that includes the new attribute value, and would configure their environment to utilize it for downstream processes to find.

Xerces C++ is an XML processor that can build DOM trees on the PSVI instead of the information set. The Post Validation Information Set does include defaulted attributes described by W3C Schema expressions.

Running the adjunct.bat file produces the following results using Xerces C++ for validation, exposing in the resulting DOM tree the defaulted adjunct URI file :


t:\ubl>if exist test-good-private-adjunct.xml del test-good-private-adjunct.xml 

t:\ubl>copy UBL-CodeList-StatusCode-Private-Adjunct-proposal.xsd UBL-CodeList-StatusCode-Use-proposal.xsd 
        1 file(s) copied.

t:\ubl>type UBL-CodeList-StatusCode-Use-proposal.xsd 
<?xml version="1.0"?>
<!--
  This is the placebo code list definition that validates against all tokens.
-->
<xsd:schema 
        targetNamespace="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:status="urn:oasis:names:tc:ubl:codelist:statuscode:proposal"
elementFormDefault="qualified"
attributeFormDefault="qualified">
  <xsd:import namespace="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81"
    schemaLocation="CoreComponentTypes-codelist-proposal.xsd"/>
  <xsd:element name="StatusCode" type="status:DerivedCodeType"/>
  <xsd:complexType name="DerivedCodeType">
    <xsd:simpleContent>
      <xsd:restriction base="cct:CodeType">
        <xsd:enumeration value="Original"/>
        <xsd:enumeration value="Copy"/>
        <xsd:enumeration value="Fraudulent"/>
        <xsd:attribute name="def" type="xsd:token" fixed="private"/>
        <xsd:attribute name="listAdjunctURI" type="xsd:anyURI" fixed="myAdjunctFile.xml"/>
      </xsd:restriction>
    </xsd:simpleContent>
  </xsd:complexType>
</xsd:schema>
t:\ubl>type test-good-private.xml 
<?xml version="1.0"?>
<xo:OrderCancellation 
  xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" 
  xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" 
  xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" 
  xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81
                      UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID>X03-20031234-0</cat:ID>
  <cat:StatusCode>Original</cat:StatusCode>
  <cat:IssueDate>2003-02-03</cat:IssueDate>
  <cat:Note>this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode>0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID>20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate>2003-02-02</cat:IssueDate>
    <cat:StatusCode>Fraudulent</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID>DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name>Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name>Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>

t:\ubl>domprint -v=always -n -s -f -wddc=off test-good-private.xml  1>output-good-private-adjunct.xml 2>domprint.err 

t:\ubl>if 0 NEQ 0 type domprint.err 

t:\ubl>type output-good-private-adjunct.xml 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><xo:OrderCancellation xmlns:xo="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.81" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.81" xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.81" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:ubl:OrderCancellation:1.0:0.81                       UBL-OrderCancellation-codelist-proposal.xsd">
  <cat:ID language="en">X03-20031234-0</cat:ID>
  <cat:StatusCode def="private" language="en" listAdjunctURI="myAdjunctFile.xml">Original</cat:StatusCode>
  <cat:IssueDate language="en">2003-02-03</cat:IssueDate>
  <cat:Note language="en" languageID="en">this cancellation is illustrative since the order has been changed too</cat:Note>
  <xo:CancellationReasonCode language="en">0</xo:CancellationReasonCode>
  <cat:OrderReference>
    <cat:BuyersDocumentID language="en">20031234-0</cat:BuyersDocumentID>
    <cat:IssueDate language="en">2003-02-02</cat:IssueDate>
    <cat:StatusCode def="private" language="en" listAdjunctURI="myAdjunctFile.xml">Fraudulent</cat:StatusCode>
  </cat:OrderReference>
  <cat:BuyerParty>
    <cat:SellerAssignedAccountID language="en">DA-VH007-G</cat:SellerAssignedAccountID>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Bills Microdevices</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:BuyerParty>
  <cat:SellerParty>
    <cat:Party>
      <cat:PartyName>
        <cat:Name language="en" languageID="en">Joes Office Supply</cat:Name>
      </cat:PartyName>
    </cat:Party>
  </cat:SellerParty>
</xo:OrderCancellation>
t:\ubl>rem Done! 

Note in the above how a processor using the PSVI output from a W3C Schema processor "sees" the defaulted attributes defined in the status code schema fragment, augmented to the original XML instance. The original XML instance shows <cat:StatusCode>Original</cat:StatusCode> while the PSVI XML instance shows <cat:StatusCode def="private" language="en" listAdjunctURI="myAdjunctFile.xml">Original</cat:StatusCode> for the processed content.

Users of UBL can then define their own code list W3C Schema fragments, include the URI of the associated adjunct information, and override the delivered code list definition with their own definition and not change the instance or the CCT file in any way. A processing application can then "see" the URI and access the adjunct file contents as documented by the adjunct file creator.

Note that at this time there are no known XSLT 2 processors that have yet implemented W3C Schema PSVI source node tree building, thus this methodology cannot yet be demonstrated in an XSL stylesheet using a single pass. However, FPSC is considering plans to use a two-step process of DOMPrint and XSLT 1.0 for access to this information.

5.  Code list catalogue

The code list catalogue for LCSC is included in the ZIP file.

This will be used to capture relevant information about code lists for documentation and development purposes. It is tied to the model spreadsheets through the first data column, titled "Documentary Namespace Prefix". Each of the columns are documented in pop-up boxes.