[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|