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]
Re: [xml-dev] XML Schema question

I came across this while trying to subset WXS and explain the use of
the subset and it is partly a curiosity to me but partly it raises questions
about what is minimally required for maximum simplicity with maximum
utility in a MicroXSD subset:

Are these three ways to do exactly the same thing, i.e. defined precisely
the same constraints on an XML instance (in this case a single element
named 'Greeting' of datatype 'string' <Greeting>Hello World</Greeting>)?

1.
<schema xmlns="http://www.w3.org/2001/XMLSchema";
attributeFormDefault="unqualified" elementFormDefault="qualified">
     <element name="Greeting">
         <complexType>
             <simpleContent>
                 <extension base="string"/>
             </simpleContent>
         </complexType>
     </element>
</schema>

2.
<schema xmlns="http://www.w3.org/2001/XMLSchema";
attributeFormDefault="unqualified" elementFormDefault="qualified">
     <element name="Greeting">
         <simpleType>
             <restriction base="string"/>
         </simpleType>
     </element>
</schema>

3.
 <schema xmlns="http://www.w3.org/2001/XMLSchema";
attributeFormDefault="unqualified" elementFormDefault="qualified">
     <element name="Greeting" type="string"/>
</schema>

I kind of tend to want to remove such redundancy unless there is some
value keeping three ways to do the same thing. I guess a processor
trying to take of advantage of only having to conform to the conformance
target of the subset might prefer to only have to handle one kind of rep-
resentation in the markup. I prefer to prune out the attribute 'type' because
it introduces complications for my metaschema but I'm inclined to prune
away the simpleType as a child of an element and just keep simple type
for an attribute. Then a processor need only expect 'complexType' as
an element child. Does this make sense? Option 1 seems to give most
extensibility so why bother with 2 and 3?

Maybe some of the redundancy could have been removed from WXS
but I guess it is too late now to make big changes in any future version.

Not having to handle multiple namespaces makes a great difference
to the pain of explaining the subset - makes me happy about MicroXML.

Cheers


----
Stephen D Green






On 01/03/2011, Stephen Green <stephengreenubl@gmail.com> wrote:
> OK, maybe it is impossible to get it perfect but I updated
> the MicroXSD subset of W3C XML Schema and gave it a
> version number '2012'  - "future-looking", "going-forward" :-)
>
> I have posted it on my blog
> http://stephengreenxml.blogspot.com/2011/02/microxsd.html
>
> Comments welcome
>
> ----
> Stephen D Green
>
>
>


[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