[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Non-xml syntax for WXS

  • To: Eric Bohlman <ebohlman@e...>
  • Subject: Re: Non-xml syntax for WXS
  • From: Jeni Tennison <jeni@j...>
  • Date: Mon, 1 Jul 2002 11:20:50 +0100
  • Cc: xml-dev@l...
  • In-reply-to: <PLEBNHKGFA9376PKD9GAHBA9WRQZTRO.3d1ea2a0@main>
  • Organization: Jeni Tennison Consulting Ltd
  • References: <PLEBNHKGFA9376PKD9GAHBA9WRQZTRO.3d1ea2a0@main>
  • Reply-to: Jeni Tennison <jeni@j...>

xmlschema elements.names
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" />

</schema>

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
work.

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).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.