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: Re: [ubl] Looking at the details on the dual schemas idea


I've just found that one of the problems
could be solved by having two prefixes
in an instance for the ATG2 schemas,
both with the same prefix.

e.g.

<?xml version="1.0" encoding="UTF-8"?>
<SomeDocument xmlns:AIAS="LocalImportedSchema"
xmlns:AIBS="LocalImportedSchema" xmlns="SomeDocument"
xmlns:uac2-0="GlobalImportedAggregateSchema"
xmlns:ubc2-0="GlobalImportedBasicSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="SomeDocument
LocalDocumentSchema.xsd">
 <AIAS:Something>
  <AIAS:SomeReference>
   <AIBS:SomeID ID="String">normalizedString</AIBS:SomeID>
  </AIAS:SomeReference>
 </AIAS:Something>
</SomeDocument>

this would validate against the following set of Local-NDR schemas

Document schema:-

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="SomeDocument" xmlns:AIAS="LocalImportedSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"; targetNamespace="SomeDocument"
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="1.0">
 <xs:import namespace="LocalImportedSchema"
schemaLocation="LocalImportedSchema.xsd"/>
 <xs:element name="SomeDocument" type="AIAS:SomeDocumentType"/>
</xs:schema>

Common schema (local-NDR):-

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns="LocalImportedSchema" xmlns:udt="SchemaModule"
targetNamespace="LocalImportedSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified" version="test">
 <xsd:import namespace="SchemaModule"
schemaLocation="../Common/UnqualifiedDataType.xsd"/>
 <xsd:complexType name="SomethingType">
  <xsd:sequence>
   <xsd:element name="SomeReference" type="SomeReferenceType"
minOccurs="0"/>
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="SomeReferenceType">
  <xsd:sequence>
   <xsd:element name="SomeID" type="IdentifierType" minOccurs="0"/>
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="SomeDocumentType">
  <xsd:sequence>
   <xsd:element name="Something" type="SomethingType" minOccurs="0"/>
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="IdentifierType">
  <xsd:simpleContent>
   <xsd:extension base="udt:IdentifierType"/>
  </xsd:simpleContent>
 </xsd:complexType>
</xsd:schema>


The same instance would validate against the corresponding global-NDR
schemas with a change of schemaLocation (here changing the prefixes too
but that is optional of course):-


<?xml version="1.0" encoding="UTF-8"?>
<SomeDocument xmlns:AIAS="LocalImportedAggregateSchema"
xmlns:AIBS="LocalImportedBasicSchema" xmlns="SomeDocument"
xmlns:uac2-0="GlobalImportedAggregateSchema"
xmlns:ubc2-0="GlobalImportedBasicSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="SomeDocument
GlobalDocumentSchema.xsd">
 <uac2-0:Something>
  <uac2-0:SomeReference>
   <ubc2-0:SomeID ID="String">normalizedString</ubc2-0:SomeID>
  </uac2-0:SomeReference>
 </uac2-0:Something>
</SomeDocument>


The global schemas would be:-

Document schema (global-NDR):-

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns="SomeDocument"
    xmlns:uac2-0="GlobalImportedAggregateSchema"
    xmlns:ubc2-0="GlobalImportedBasicSchema"
    targetNamespace="SomeDocument"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="1.0">
  <xsd:import namespace="GlobalImportedAggregateSchema"
schemaLocation="GlobalImportedAggregateSchema.xsd"/>
  <xsd:import namespace="GlobalImportedBasicSchema"
schemaLocation="GlobalImportedBasicSchema.xsd"/>
  <xsd:element name="SomeDocument" type="SomeDocumentType"/>
   <xsd:complexType name="SomeDocumentType">
    <xsd:sequence>
      <xsd:element ref="uac2-0:Something" minOccurs="0" maxOccurs="1"/>
     </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

Common aggregates schema (global-NDR):-


<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns="GlobalImportedAggregateSchema"
xmlns:ubc2-0="GlobalImportedBasicSchema"
targetNamespace="GlobalImportedAggregateSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="test">
 <xsd:import namespace="GlobalImportedBasicSchema"
schemaLocation="GlobalImportedBasicSchema.xsd"/>
 <xsd:element name="Something" type="SomethingType"/>
 <xsd:element name="SomeReference" type="SomeReferenceType"/>
 <xsd:complexType name="SomethingType">
  <xsd:sequence>
   <xsd:element ref="SomeReference" minOccurs="0"/>
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="SomeReferenceType">
  <xsd:sequence>
   <xsd:element ref="ubc2-0:SomeID" minOccurs="0"/>
  </xsd:sequence>
 </xsd:complexType>
</xsd:schema>

Common basics schema (global-NDR):-

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns="GlobalImportedBasicSchema" xmlns:udt="SchemaModule"
targetNamespace="GlobalImportedBasicSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified" version="test">
 <xsd:import namespace="SchemaModule"
schemaLocation="../Common/UnqualifiedDataType.xsd"/>
 <xsd:element name="SomeID" type="IdentifierType"/>
 <xsd:complexType name="IdentifierType">
  <xsd:simpleContent>
   <xsd:extension base="udt:IdentifierType"/>
  </xsd:simpleContent>
 </xsd:complexType>
</xsd:schema>

And all using the same datatypes schema:-

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="SchemaModule" xmlns:udt="SchemaModule"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:complexType name="IdentifierType">
  <xsd:simpleContent>
   <xsd:extension base="xsd:normalizedString">
    <xsd:attribute name="ID" type="xsd:normalizedString" use="optional">
    </xsd:attribute>
   </xsd:extension>
  </xsd:simpleContent>
 </xsd:complexType>
</xsd:schema>


I could then hope to find that transformations between these are
possible with XSLT


Corresponding minor version schemas would hopefully be doable
although transformations would probably require XSLT 2.0


All the best

Stephen Green







----- Original Message ----- 
From: "Stephen Green" <stephen_green@seventhproject.co.uk>
To: <ubl@lists.oasis-open.org>
Sent: Wednesday, June 15, 2005 12:14 PM
Subject: [ubl] Looking at the details on the dual schemas idea


> Greetings
>
> Just further considering the idea that
> there might be a way to have both global
> (UBL NDR) and local (ATG2 NDR) schema
> sets which each validate the exact same
> instances:- If that were achievable (albeit
> with compromises to the strictness of the
> local rules, which seems unpalatable) I
> had the idea that a stylesheet transformation
> might be a way to generate the local from
> the global schema sets.
>
> I started to demonstrate that the transformation
> seems quite feasible BUT the main problem is
> that local schemas are by nature less
> modular with less room to separate out
> different namespaces. This means that it
> isn't really feasible where the global schemas
> are modularized such as between BBIEs and
> ABIEs. UBL's design has a document in one
> namespace, BBIEs within the document
> structure in another namespace with another
> prefix and ABIEs within the same document
> in another namespace again with another
> prefix again. This distinction between
> namespaces and prefixes from the instance
> point of view can't be represented with local
> design rules without making BBIEs global, in
> a separate module, and putting the document
> complexType in the ABIE module. [See
> example attached]. If this is done then it
> should, I reckon, be a straigtforward (but not
> exactly trivial) matter to transform between
> NDRs. Then the main difficulty left is in
> transforming in minor versions.
>
> [This is where it may become necessary to keep
> to a transformation from global to local rather
> than local to global, due to the greater amount
> of information likely to be contained in global.]
>
> However, the main consideration, it seems to
> me, is not the fact that minor versions may be
> so different and require complexity in XSLT
> transformations (say with XSLT 2.0) but the
> fact that this is all only feasible, as far as I can
> see, with a departure of the local NDR away
> from all local to some local, some global with
> a similar modularity to the global NDR.
>
> All the best
>
> Stephen Green
>
>


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


> ---------------------------------------------------------------------
> To unsubscribe from this mail list, you must leave the OASIS TC that
> generates this mail.  You may a link to this group and all your TCs in
OASIS
> at:
> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php



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