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

Modular schemas.

  • From: Olivier Rossel <olivier.rossel@gmail.com>
  • To: xml-dev@lists.xml.org
  • Date: Mon, 11 Jan 2010 15:38:05 +0100

Modular schemas.
I wish I could create a modular schema, where I can override some
definitions in future versions
of the schema.
At the moment, I plan to use substitutionGroup, but I am still unsure
of the original schema
to define.

Here is for example the schema for a <optionalAttribute> element:

   <xs:element name="optionalAttribute" type="optionalAttribute_type">
   </xs:element>

  <xs:complexType name="optionalAttribute_type" mixed="true">
     <xs:group ref="optionalAttribute_elements"/>
     <xs:attributeGroup ref="optionalAttribute_attributes"/>
   </xs:complexType>

   <xs:attributeGroup name="optionalAttribute_attributes">
   </xs:attributeGroup>

   <xs:group name="optionalAttribute_elements">
   </xs:group>

This schema is pretty much hollow. No specified attribute, no specified inner
content (except textual content, via the mixed="true")

I hope such a schema to validate this XML with no problem:

<optionalAttribute
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Issue1.xsd" >
text
</optionalAttribute>


Unfortunately, this schema is invalid : It is illegal to create an
empty "optionalAttribute_elements" group.
What is the correct way to define a group that contains nothing? or just text?

Note: Please keep in mind that this schema is engineered that way so
future versions of the schema can heavily refactor the groups, via
xsd:substitutionGroup).


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


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.