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

SAX2: NOTATION attribute decls

  • From: David Brownell <david-b@p...>
  • To: xml-dev@x...
  • Date: Mon, 06 Mar 2000 07:53:21 -0800

notation attribute
I don't remember where I mentioned this before, but the issue is still
unresolved so it needs to be raised again ...

The problem is that the DeclHandler.attributeDecl() callback doesn't show
what the permitted values for a NOTATION attribute are.

To recap, there are two types of enumerated attributes in XML, and NOTATION
attributes are one of them.  The difference between these two declarations:

  <!ATTLIST elementType aNotation NOTATION (png | jpg | gif) #REQUIRED>
  <!ATTLIST elementType anEnumeration      (png | jpg | gif) #REQUIRED>

from the XML perspective is that [a] in the former case three notations
("png", "jpg", "gif") must first be declared, and [b] there may only be one
NOTATION attribute per element.  (The latter is courtesy of a new erratum,
which says in effect that NOTATION attributes suggest classes, not types,
for the elements with which they're associated.)

>From the SAX2beta(2) perspective, the callbacks look different:

  attributeDecl ("elementType", "aNotation",     "NOTATION",
	"#REQUIRED", null);
  attributeDecl ("elementType", "anEnumeration", "(png|jpg|gif)",
	"#REQUIRED", null);

Information is clearly lost.  Layered software can't test restriction [a],
or the constraint that any value which is provided for that attribute be
one of the permissible ones.

This matters when working with DTDs, such as Docbook, that use NOTATION
attributes.

How to fix the NOTATION decl problem?  Two solutions come quickly to mind:

	(1) There could be distinct callbacks for enumerated and
	    non-enumerated attributes.  For example, passing an
	    array of permissible values for enumerated values.

	(2) Pass an ugly string like "NOTATION(gif|png|jpg)" for
	    the notation type.

Were I doing this from scratch, (1) would certainly be my choice.  In
fact that's what I did with Sun's parser about 16 months ago, based on
the earliest SAX2 discussions on record.  But at this point, (2) might
be the expedient fix to SAX2 (given the impetus to call it "done" ASAP).

Comments?

- Dave

***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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.