OASIS Open Mailing List Archives  ·  All Lists  ·  ubl  ·  2005-06

ubl — archive

[Date Prev]  |  [Thread Prev]  |  [Thread Next]  |  [Date Next]   —  [Date Index]  |  [Thread Index]  |  [Month Index]  |  [List Home]

Re: [ubl] Looking at the details on the dual schemas idea


 MHonArc v2.5.0b2 -->

















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









[Date Prev]  |  [Thread Prev]  |  [Thread Next]  |  [Date Next]   —  [Date Index]  |  [Thread Index]  |  [Month Index]  |  [List Home]