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

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl message

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


Subject: Problems on Translating UBL XSD Schema into Relax NG (3/6)


Hi,

I send the report 3/6 about Problems on Translating UBL XSD 
Schema into Relax NG. 

I will post UBL schema library describing with Relax NG this weekend.
What license description must be included in Relax NG codes? 

We are writing schema translating rules, about 40 pages in Japanese.
Could Relax NG schemas and rules be included in final UBL 1.0 package?

Thanks

-----------------------------------------------------------------
3. Multiple <import>ing of the same schema document

3.1 The UBL Schema Description using XSD
 With XSD, even if the same schema document is imported multiple
times, validation error don't occur. For efficiency,
almost XML applications avoid importing the same schema document
more than once. So each XSD schema in UBL library imports
other schemas by which it use to define elements and types. 

For example, CoreComponentParameters schema which defines elements
and types for describing annotation is imported in all UBL XSD
schemas.

Codes from common/UBL-RepresentationTerms-1.0-beta.xsd
  <xsd:import namespace="urn:oasis:names:tc:ubl:CoreComponentTypes:1:0-beta"
    schemaLocation="UBL-CoreComponentTypes-1.0-beta.xsd"/>
  <xsd:import namespace="urn:oasis:names:tc:ubl:CoreComponentParameters:1:0-beta"
    schemaLocation="UBL-CoreComponentParameters-1.0-beta.xsd"/>

Codes from maindoc/UBL-Invoice-1.0-beta.xsd
  <xsd:import namespace="urn:oasis:names:tc:ubl:CoreComponentParameters:1:0-beta"
   schemaLocation="../common/UBL-CoreComponentParameters-1.0-beta.xsd" />
  <xsd:import namespace="urn:oasis:names:tc:ubl:RepresentationTerms:1:0-beta"
   schemaLocation="../common/UBL-RepresentationTerms-1.0-beta.xsd" />
  <xsd:import namespace="urn:oasis:names:tc:ubl:CommonAggregateTypes:1:0-beta"
   schemaLocation="../common/UBL-Reusable-1.0-beta.xsd" />
  <xsd:import namespace="urn:oasis:names:tc:ubl:codelist:InvoiceTypeCode:1:0-beta"
   schemaLocation="../codelist/use/UBL-CodeList-InvoiceTypeCode-Use-1.0-beta.xsd" />
  <xsd:import namespace="urn:oasis:names:tc:ubl:codelist:CurrencyCode:1:0-beta"
   schemaLocation="../codelist/use/UBL-CodeList-CurrencyCode-Use-1.0-beta.xsd" />

3.2 The UBL Schema Description using Relax NG
1) Problem
 Though Relax NG has a feature including other schemas, it 
don't have a feature importing other schemas. If the same
schema document is imported multiple times, validation error
will occur. 

2) Solution
 With Relax NG schema, instead of including other schemas in
each schema using them,  only some schemas would include schemas as
the follows:

(a) Reusable includes all Codelist schemas.

Generated Codes in UBL-Reusable-1.0-beta.rng
  <include href="../codelist/use/UBL-CodeList-TaxLevelCode-Use-1.0-beta.rng" />
  <include href="../codelist/use/UBL-CodeList-TransportEquipmentSizeTypeCode-Use-1.0-beta.rng" />
  <include href="../codelist/use/UBL-CodeList-TransportEquipmentTypeCode-Use-1.0-beta.rng" />
  <include href="../codelist/use/UBL-CodeList-HazardousPackingCriteriaCode-Use-1.0-beta.rng" />
  ...

(b) Maindoc schemas include CoreComponentParameters, RepresentationTerms and Reusable. 

Generated Codes in UBL-Invoice-1.0-beta.rng
  <include href="../common/UBL-CoreComponentParameters-1.0-beta.rng" />
  <include href="../common/UBL-RepresentationTerms-1.0-beta.rng" />
  <include href="../common/UBL-Reusable-1.0-beta.rng" />

 CoreComponentTypes schema is referred from only RepresentationTerms,
and is used to derive restricted Types from CoreComponentTypes,
then CoreComponentTypes is not included in any Relax NG schemas. 
DataTypes is not included also.

 These inclusion rules are sufficient to validate XML documents
using Relax NG schemas, but are not sufficient to validate each
Relax NG schema. So lines for including referred schemas are left
as a comment as the follows:

Generated Codes in UBL-RepresentationTerms-1.0-beta.rng
  <!-- <include href="CoreComponentParameters:1:0-beta.rng"> -->

3.3 Proposition to Relax NG language specification.
 When describing a large schama library using Relax NG, 
it is too difficult to manage the relationship between
component schemas because of the lack of XSD-like importing
feature. Relax NG should support features importing other
schema and avoiding to import them multiple times.

-----------------------------------------------------------------




-----
Hiroshi Naito, Osaka Institute of Technology <http://www.oit.ac.jp/>



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