kshychko / ausdigital-syn-v1

Ausdigital XML Implementation specification
http://ausdigital.org/syn/
0 stars 1 forks source link

Convert the complex hierarchy of DBC Schema files into a simple runtime single root invoice..xsd #3

Closed onthebreeze closed 7 years ago

onthebreeze commented 7 years ago

From @onthebreeze on December 5, 2016 11:1

Refer to #2

The schema library as presented has several problems for runtime implementation

Therefore, lets make a simple single root XSD that defines the structure of the Australian implementation as per the semantic model.

      <xsd:sequence>
         <xsd:element ref="cbc:CityName" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
               <xsd:documentation>
                  <dbc:Component>
                     <dbc:InformationElement>City</dbc:InformationElement>
                  </dbc:Component>
                  <ccts:Component>
                     <ccts:ComponentType>BBIE</ccts:ComponentType>
                     <ccts:DictionaryEntryName>Address. City Name. Name</ccts:DictionaryEntryName>
                     <ccts:Definition>The name of a city, town, or village.</ccts:Definition>
                     <ccts:Cardinality>0..1</ccts:Cardinality>
                     <ccts:ObjectClass>Address</ccts:ObjectClass>
                     <ccts:PropertyTerm>City Name</ccts:PropertyTerm>
                     <ccts:RepresentationTerm>Name</ccts:RepresentationTerm>
                     <ccts:DataType>Name. Type</ccts:DataType>
                     <ccts:AlternativeBusinessTerms>LocalityName</ccts:AlternativeBusinessTerms>
                     <ccts:Examples>Hong Kong </ccts:Examples>
                  </ccts:Component>
               </xsd:documentation>
            </xsd:annotation>

should be more like

      <xsd:sequence>
         <xsd:element ref="CityName" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
               <xsd:documentation> 
                         The name of a city, town, or village.
               </xsd:documentation>
            </xsd:annotation>

Lets put our new Schema in our docs directory at https://github.com/ausdigital/billing-semantics/tree/master/docs

And then please modify all the sample XML in the testsets directory so that they validate against our new schema - I expect that'll mostly just mean removing namespace declarations and prefixes and most of the attributes. Lets put our new XML samples in a /xml_testsets subdirectory in our /docs folder - leaving the originals unchanged and still validating against the big schema library.

Copied from original issue: ausdigital/billing-semantics#3

onthebreeze commented 7 years ago

Closing this - decided not to do it. Preferred approach is to leave the UBL XML un-touched so that interoperability is maintained. Instead focus on a lossless transform to a simple JSON representation