[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Is it possible to cascade schemas?

  • From: jdg <jdg@n...>
  • To: xml-dev@l...
  • Date: Mon, 17 Jul 2000 15:06:04 +0900

cascade routers
 
For data modeling purpose, I want to cascade 2 schemas as described in the following example:
 
 1) a schema that describes a object class structure: here a mib is componed of classes that include its name and its position in an inheritance tree.
 
<?xml version='1.0'?>
<!-- schema_schema_test_2.xsd -->
 
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
               xmlns:dt="urn:schemas-microsoft-com:datatypes">
 
<AttributeType name="name" dt:type="string"/>
<AttributeType name="derivedFrom" dt:type="string"/>  
 
<ElementType name="class">
     <attribute type="name"/>
     <attribute type="derivedFrom"/>
</ElementType>
 
<ElementType name="mib">
     <element type="class"/>
</ElementType>

</Schema>
 
2) a schema that uses the class structure described in the prior schema and define the class "equipment" that derives from the top class and contains 1 attribute called "userLabel":
 
<?xml version='1.0'?>
<!-- schema_test_2.xsd -->
 
<mib xmlns="x-schema:schema_schema_test_2.xsd"
         xmlns:dt="urn:schemas-microsoft-com:xml-data">
 
<dt:AttributeType name="UserLabel" type="string"/>
 
<moc name="equipment" derivedFrom="top">
     <dt:attribute type="UserLabel" name="userLabel"/> 
</moc>
 
<dt:ElementType name="model">
     <dt:element type="equipment"/>
</dt:ElementType>
 
</mib>
 
3) then the instance document has the following aspect: the model contains 2 equipment class called Fr_It 2_1 and Fr_Br 3_0
 
<?xml version='1.0'?>
<!-- data_test_2.xml -->
 
<model xmlns="x-schema:schema_test_2.xsd">
 
<equipment userlabel="router Fr_It 2_1"/>
<equipment userlabel="router Fr_Br 3_0"/>
</model>
 
 
? This example doesn t work: the second schema is valid against the first schema, but there is an error while checking the well-formness of the instance document. I am a little bit confused since a simpler example with only one schema works well. Am I missing something?
 
        Thanks,
        J-Daniel.
 
 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.