OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Non-xml syntax for WXS

[ Lists Home | Date Index | Thread Index ]

Hi Eric,

> Possibly aside the point, but I personally find it rather annoying
> that just about all the examples I've seen of XSD syntax use
> fully-prefixed elements names, despite the fact that none of the
> elements are outside the XSD namespace. I guess it reminds me too
> much of MS-Hungarian notation, which I also personall find
> unreadable.

Unfortunately, in XML Schema you don't have to only worry about
whether the *elements* are in a particular namespace, you also have to
consider the namespaces used in the QNames that are used to refer to
other components in the schema (and within the XPaths used to define
identity constraints).

If you write a schema that doesn't have a target namespace, then you
really *have* to use a prefix for the XML Schema namespace. Otherwise,
you quickly get into situations like:

<schema xmlns="http://www.w3.org/2001/XMLSchema";>

<element name="foo" type="bar" />
<complexType name="bar" />


Here, the reference type="bar" doesn't use a prefix, so is interpreted
using the default namespace, as meaning
{http://www.w3.org/2001/XMLSchema}bar rather than {}bar. Since there's
no {http://www.w3.org/2001/XMLSchema}bar type, the schema doesn't

So for simple examples, there's not much choice over whether to use a
prefix or not. Of course for more complex examples you do have the
choice, but personally I think it's less confusing to be consistent
with element names rather than swapping back and forward (especially
when teaching since people can find namespaces hard to get a grip on).



Jeni Tennison


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

Copyright 2001 XML.org. This site is hosted by OASIS