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

Re: Why you should avoid Notation Declarations (by


notation declared in schema
"G. Ken Holman" <gkholman@C...> writes:

> At 2005-02-23 14:51 +0000, Henry S. Thompson wrote:
>>Sorry not to be clearer -- in both this and your next message, the
>>things you're expressing surprise/concern about are attempts to
>>understand my messages as if they were about NOTATIONs and their
>>declaration and use in XML 1.0/1.1 DTDs and DTD-based validation of
>>instances.
>>
>>But my message was about the simple type definition of the same name
>>in W3C XML Schema, which reconstructs but does _not_ interact with the
>>DTD-declared attribute type.
>
> My apologies, Henry, thanks for this clarification.
>
> So, I now see when using NOTATION declarations in W3C Schema, part 1
> section 3.12.1 makes reference to a target namespace.
>
> But W3C Schema part 2 section 3.2.19 states that notation represents
> the notation attribute type from XML 1.0 ... 

No wonder you're confused.  That's a bug that should have been fixed
ages ago, sorry!

> So, I have an XML document:
>
> <!DOCTYPE doc [
> <!ELEMENT doc ( thing+ )>
> <!ELEMENT thing ( #PCDATA )>
> <!ATTLIST thing n NOTATION ( abc | def ) #REQUIRED>
> <!NOTATION abc SYSTEM "abc-stuff">
> <!NOTATION def SYSTEM "def-stuff">
> ]>
> <doc>
>    <thing n="abc">abc here</thing>
>    <thing n="def">def here</thing>
> </doc>
>
> When abandoning the DTD and writing a W3C Schema expression for this
> instance, I gather from your comment that the notation names are
> QNames, just like the element names are QNames. But while interpreting
> the elements as QNames is consistent with the XML Information set
> section 2.2, section 2.3 Attribute Information Items makes reference
> to attributes of type NOTATION as naming the NOTATION information
> item, which doesn't have a namespace component.

But attributes with [attribute type] NOTATION in the infoset may or
may not be of [schema type definition] xs:NOTATION.  W3C XML Schema
validation is _only_ concerned with the latter.  True, if an attribute
is _both_ then the 'for compatibility' Note and Richard Tobin's
preceding message apply, and you'd better use no namespace in your
schema or use the default namespace for it in your instance.

> So, I wasn't expecting W3C Schema to change the game for components of
> XML in this fashion, because W3C Schema Part 1, section 1.2 states it
> depends on the XML Infoset.  Though I do note that Annex D does not
> require support for notation information items.

W3C XML Schema doesn't change anything in the infoset, not here or
elsewhere, with the marginal exception of defaulted attrs and elts.

To re-iterate, to be a DTD-valid NOTATION, no colon is allowed.  W3C
XML Schema cannot change that, and does not try.

To be a schema-valid xs:NOTATION, you must name a schema-declared
Notation.  Notations are named in schemas with qualified names.

So, to be both a DTD-valid NOTATION and a schema-valid xs:NOTATION,
an attribute value must be an NCName and either

  1) there is a no default namespace declaration in scope and a
     schema available with no target namespace and a Notation with the
     given name

 or

  2) there _is_ a default namespace declaration in scope and a schema
     available with the default namespace as its target namespace and
     a Notation with the given name.

ht
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@i...
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]

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.