[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A microSchema Was: MicroXSD for MicroXML?
In writing an XSD schema using MicroXML the issue was in declaring globals (groups, attributes or elements) without the use of XML namespace prefixes. I would need, I think, to have more than one namespace declaration in the schema - one for the schema itself and another for the standard "http://www.w3.org/2001/XMLSchema". There seems to be no problem just having local elements and attributes but this does limit greatly what I can do with the schema. Maybe another answer would be to be allowed to define such a MicroXSD schema without the "http://www.w3.org/2001/XMLSchema" namespace - but then, I guess, existing XSD tools would be unlikely to 'understand' it. It seems to me that if a MicroRNG does not require the use of a RelaxNG namespace then it might have an edge on a 'MicroXSD' profile as it would leave open the possibility to add a user-defined namespace without any prefix using just the simple 'xmlns' attribute. ---- Stephen D Green On 22 December 2010 09:59, Stephen Green <stephen.green@documentengineeringservices.com> wrote: > 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] |
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
|