[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [ubl-dev] Simpler-Than-UBL Design Rules
Here's an example of the schema design which is not for a UBL document (I've not tried that yet) but a schema for the PreisShare price list (just experimental draft). It just illustrates the design I have in mind. It is designed to map well to a UBL subset of Catalogue. In this form there would need to be more subsetting of the UBL to include datatypes if the subset is to be normative for the context and the PreisShare xml to be fully compliant with the UBL subset. Otherwise there would be some attributes in the UBL not provided for in the PreisShare (some might say that is being too 'picky' though). I'm pretty sure making CAM the normative definition of the subset though would help that and could be made CCTS compliant provided there is an understanding that the datatypes are subsetted as if they were qualified datatypes (in the CCTS sense) - or something like that anyway. All the best Stephen Green <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="Actual_Price" type="Amount_Type"/> <xs:element name="Address_Line_1" type="Simple_Text_Type"/> <xs:element name="Address_Line_2" type="Simple_Text_Type"/> <xs:element name="Country_Code" type="Country_Code_Type"/> <xs:complexType name="Country_Code_Type"> <xs:simpleContent> <xs:extension base="xs:normalizedString"> <xs:attribute name="list_ID" type="xs:normalizedString"/> <xs:attribute name="url" type="xs:anyURI" default="http://docs.oasis-open.org/ubl/os-ubl-2.0/cl/gc/default/CountryIdentificationCode-2.0.gc"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:element name="Group_Description" type="Simple_Text_Type"/> <xs:element name="Name" type="Simple_Text_Type"/> <xs:element name="Organisation_Name" type="Simple_Text_Type"/> <xs:element name="PLU" type="Simple_Identifier_Type"/> <xs:element name="PreisShare_ID" type="Simple_Identifier_Type"/> <xs:element name="Price_Base_Quantity" type="Simple_Quantity_Type"/> <xs:element name="Price_List" type="Price_List_Type"/> <xs:complexType name="Price_List_Type"> <xs:sequence> <xs:element ref="Vendor_Information"/> <xs:element ref="Receiver_Information"/> <xs:element ref="Product_Information"/> </xs:sequence> <xs:attribute name="price_List_ID" type="xs:normalizedString" use="required"/> <xs:attribute name="issue_Date" type="xs:date" use="required"/> </xs:complexType> <xs:element name="Product" type="Product_Type"/> <xs:complexType name="Product_Type"> <xs:sequence> <xs:element ref="PLU"/> <xs:element ref="Name"/> <xs:element ref="Actual_Price" minOccurs="0"/> <xs:element ref="Price_Base_Quantity" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:element name="Product_Group" type="Product_Group_Type"/> <xs:complexType name="Product_Group_Type"> <xs:sequence> <xs:element ref="Group_Description"/> <xs:element ref="Product_Items"/> </xs:sequence> </xs:complexType> <xs:element name="Product_Information" type="Product_Information_Type"/> <xs:complexType name="Product_Information_Type"> <xs:sequence> <xs:element ref="Product_Group"/> </xs:sequence> </xs:complexType> <xs:element name="Product_Items" type="Product_Items_Type"/> <xs:complexType name="Product_Items_Type"> <xs:sequence> <xs:element ref="Product" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:element name="Receiver_Information" type="Receiver_Information_Type"/> <xs:complexType name="Receiver_Information_Type"> <xs:sequence> <xs:element ref="PreisShare_ID"/> <xs:element ref="Organisation_Name"/> <xs:element ref="Address_Line_1"/> <xs:element ref="Address_Line_2"/> <xs:element ref="Suburb_Town"/> <xs:element ref="State_Region"/> <xs:element ref="ZIP_Postcode"/> <xs:element ref="Country_Code"/> </xs:sequence> </xs:complexType> <xs:element name="State_Region" type="Simple_Text_Type"/> <xs:element name="Suburb_Town" type="Simple_Text_Type"/> <xs:element name="Vendor_Information" type="Vendor_Information_Type"/> <xs:complexType name="Vendor_Information_Type"> <xs:sequence> <xs:element ref="PreisShare_ID"/> <xs:element ref="Organisation_Name"/> <xs:element ref="Address_Line_1"/> <xs:element ref="Address_Line_2"/> <xs:element ref="Suburb_Town"/> <xs:element ref="State_Region"/> <xs:element ref="ZIP_Postcode"/> <xs:element ref="Country_Code"/> </xs:sequence> </xs:complexType> <xs:element name="ZIP_Postcode" type="Simple_Text_Type"/> <xs:complexType name="Amount_Type"> <xs:simpleContent> <xs:extension base="xs:decimal"> <xs:attribute name="iso_3166-1_Currency_Code" type="xs:normalizedString" use="required"/> <xs:attribute name="url" type="xs:anyURI" default="http://docs.oasis-open.org/UBL/os-UBL-2.0/cl/gc/cefact/CurrencyCode-2.0.gc"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="Simple_Code_Type"> <xs:simpleContent> <xs:extension base="xs:normalizedString"> <xs:attribute name="listID" type="xs:normalizedString"/> <xs:attribute name="url" type="xs:anyURI"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="Simple_Identifier_Type"> <xs:simpleContent> <xs:extension base="xs:normalizedString"> <xs:attribute name="schemeID" type="xs:normalizedString"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="Simple_Quantity_Type"> <xs:simpleContent> <xs:extension base="xs:decimal"> <xs:attribute name="unece_7_04_Units_Of_Measure_Code" type="xs:normalizedString" use="required"/> <xs:attribute name="unece_7_04_Units_Of_Measure_Name" type="xs:string"/> <xs:attribute name="url" type="xs:anyURI" default="http://docs.oasis-open.org/UBL/os-UBL-2.0/cl/gc/cefact/UnitOfMeasureCode-2.0.gc"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="Simple_Text_Type"> <xs:simpleContent> <xs:extension base="xs:string"/> </xs:simpleContent> </xs:complexType> </xs:schema> Quoting stephen.green@systml.co.uk: >>> >>> Conclusion: the most obvious answer (short of moving the mountain >>> which might be an alternative answer but make take longer) is to >>> produce some naming and design rules for a simplified but UBL-like >>> subsetted document type. >>> >>> It might look like this >>> >>> 1. single physical file, no imports or includes >>> 2. single namespace >>> 3. UBL rules for element and complex type naming (optional rule) >>> 4. all global element definitions >>> 5. all global complex type definitions >>> 6. creation of complex and simple types for reusable datatypes based on >>> those of ATG2/UBL >>> but defined in the same namespace as the above and within the same >>> module/physical file >>> (CCTS-compliant qualified datatypes but without any imports or >>> external namespaces) >>>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]