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

"Meta"-schema design

  • To: <xml-dev@l...>
  • Subject: "Meta"-schema design
  • From: "Leo Trottier" <leo.trottier@q...>
  • Date: Tue, 23 Jul 2002 14:54:51 -0400
  • Thread-index: AcIyem0ZeKU+Ydv2Q4+o1oZv/PJdcg==
  • Thread-topic: "Meta"-schema design

meta schema
While it is obvious that it is possible to construct a W3C Schema design file that uses other schemata within it to specify child elements, I am curious if anyone might know how to perform the following task.  

(While this may not be good software design, I have been asked to use this architecture anyway.)

I would like to create a schema that will, in an instance document, allow for the arbitrary specification of child elements (in certain locations of the Schema doc, e.g. specified by <xsd:any/>) based on arbitrary Schema files.  

A code snippet of such an implementation might look like this in the the highest Schema document.

************
...
<xs:complexType>
	<xs:sequence>
		<xs:element ref="MethodDef"/>
		<xs:any namespace="##any" processContents="strict" maxOccurs="unbounded"/>
	</xs:sequence>
</xs:complexType>
...
************
highest.xsd

One of many possible lower level .xsd's might look like this:

************
...
<xs:element name="Document'sRootElement">
	<xs:complexType>
		<xs:sequence>
			<xs:element ref="SubElement1" />
			<xs:element ref="SubElement2"/>
		</xs:sequence>
		<xs:attribute ref="OptionalAttrb"/>
	</xs:complexType>
</xs:element>
...
**************
arbitrarySchema.xsd

The xml code then, hopefully, would look something like this.  It would be very convenient if all that was required in the instance document was an in-element reference to arbitrarySchema.xsd, whose children didn't require qualification.

***************
...
<MethodDef> org.w3c.xml.SomeMethod() </MethodDef>
<Document'sRootElement [some type of reference here to arbitrarySchema.xsd (xmlns? namespace?)  Would correspond to
org.w3c.xml.SomeMethod()] >
	<SubElement1>
		...
	</SubElement1>
	<SubElement2>
		...
	</SubElement2>
</Document'sRootElement>
*****************

As you can tell, the usefulnes of this would be to create XML files that could work in conjunction with particular classes specified in the XML document, and the arbitrarySchema would outline the settings unique to the specified class.  Thus, after production of a product, functionality could  be easily added while only editing the instance .xml document, adding new arbitrarySchema.xsd type documents, and tacking on a package to the product that has the corresponding method within it (in this case org.w3c.xml.SomeMethod()).

That's all to say: is there a simple way of calling on arbitrary .xsd documents within .xml files (<Element xmlns="myChildSchema.xsd">...</Element>)?  Again, avoiding defining the namespace at the top of the .xml document would be useful.


Thanks in advance, 

Leo Trottier

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.