XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
A microSchema Was: [xml-dev] MicroXSD for MicroXML?

After issues trying to produce a MicroXML XSD schema
which is at least self-valid/self-validating and functional
I concluded that the requirements regarding namespaces
for full XML Schema v1 compatibility not really compatible
with the concept of a MicroXML. Rather than give up, I
went for a compromise which resulted in an actual
MicroXML instance with the same syntax (and, I hope,
same semantics albeit modified somewhat for MicroXML)
as W3C XML Schema but not actually executable in
W3C XML Schema tools: It would require new, hopefully
lightweight / MicroXML-ish, tools to use it to validate a
MicroXML instance. I guess it cannot be called XSD so I
would dub it a microSchema (XSD-esque?) describing
itself but relying on reference to XSD (W3C XML Schema)
for its semantics. (Again, no guarantees about it being
worthy of actual use or error-free...). The bindings to any
datatypes are left out of the schema and would be applied
separately (Micro-Genericode??? :-); it does includes 'string'
- in the spirit of minimalism and text-centric MicroXML.

Regards

Stephen D Green

<schema>
	<!-- start of root element -->
	<element name="schema">
		<complexType>
			<group ref="schema_group" minOccurs="0" maxOccurs="unbounded"/>
			<attribute name="version" type="string" use="optional"/>
			<attribute name="attributeFormDefault" type="string" use="optional"/>
			<attribute name="elementFormDefault" type="string" use="optional"/>
		</complexType>
	</element>
	<!-- end of root element -->
	<group name="schema_group">
		<choice>
			<element ref="element"/>
			<element ref="attribute"/>
			<element ref="group"/>
		</choice>
	</group>
	<element name="element">
		<complexType>
			<group ref="element_group" minOccurs="0"/>
			<attribute ref="ref" use="optional"/>
			<attribute ref="name" use="optional"/>
			<attribute ref="type" use="optional"/>
			<attribute ref="minOccurs" use="optional"/>
			<attribute ref="maxOccurs" use="optional"/>
		</complexType>
	</element>
	<attribute name="ref" type="string"/>
	<attribute name="name" type="string"/>
	<attribute name="type">
		<simpleType>
			<restriction base="string"/>
		</simpleType>
	</attribute>
	<attribute name="minOccurs">
		<simpleType>
			<restriction base="string">
				<enumeration value="0"/>
				<enumeration value="1"/>
			</restriction>
		</simpleType>
	</attribute>
	<attribute name="maxOccurs">
		<simpleType>
			<restriction base="string">
				<enumeration value="1"/>
				<enumeration value="unbounded"/>
			</restriction>
		</simpleType>
	</attribute>
	<element name="attribute">
		<complexType>
			<group ref="attribute_group" minOccurs="0"/>
			<attribute ref="use" use="optional"/>
			<attribute ref="ref" use="optional"/>
			<attribute ref="name" use="optional"/>
			<attribute ref="type" use="optional"/>
		</complexType>
	</element>
	<attribute name="use">
		<simpleType>
			<restriction base="string">
				<enumeration value="optional"/>
				<enumeration value="required"/>
			</restriction>
		</simpleType>
	</attribute>
	<element name="group">
		<complexType>
			<group ref="group_group" minOccurs="0"/>
			<attribute ref="ref" use="optional"/>
			<attribute ref="name" use="optional"/>
			<attribute ref="minOccurs" use="optional"/>
			<attribute ref="maxOccurs" use="optional"/>
		</complexType>
	</element>
	<group name="group_group">
		<choice>
			<element ref="choice"/>
		</choice>
	</group>
	<element name="choice">
		<complexType>
			<group ref="choice_group" minOccurs="0" maxOccurs="unbounded"/>
		</complexType>
	</element>
	<group name="choice_group">
		<choice>
			<element ref="element"/>
			<element ref="group"/>
		</choice>
	</group>
	<group name="element_group">
		<choice>
			<element ref="complexType"/>
			<element ref="simpleType"/>
		</choice>
	</group>
	<group name="attribute_group">
		<choice>
			<element ref="simpleType"/>
		</choice>
	</group>
	<element name="complexType">
		<complexType>
			<group ref="complexType_group" minOccurs="0" maxOccurs="unbounded"/>
			<attribute ref="mixed" use="optional"/>
		</complexType>
	</element>
	<group name="complexType_group">
		<choice>
			<element ref="attribute"/>
			<element ref="group"/>
		</choice>
	</group>
	<attribute name="mixed">
		<simpleType>
			<restriction base="string">
				<enumeration value="true"/>
				<enumeration value="false"/>
			</restriction>
		</simpleType>
	</attribute>
	<element name="simpleType">
		<complexType>
			<group ref="simpleType_group"/>
		</complexType>
	</element>
	<group name="simpleType_group">
		<choice>
			<element ref="restriction"/>
		</choice>
	</group>
	<element name="restriction">
		<complexType>
			<group ref="restriction_group" minOccurs="0" maxOccurs="unbounded"/>
			<attribute ref="base" use="optional"/>
			<attribute ref="value" use="optional"/>
		</complexType>
	</element>
	<attribute name="value" type="string"/>
	<group name="restriction_group">
		<choice>
			<element ref="enumeration"/>
		</choice>
	</group>
	<element name="enumeration">
		<complexType>
			<attribute ref="value" use="required"/>
		</complexType>
	</element>
	<attribute name="base">
		<simpleType>
			<restriction base="string"/>
		</simpleType>
	</attribute>
</schema>


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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS