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

Re: References in default attribute values

  • From: Joe English <jenglish@c...>
  • To: xml-dev@i...
  • Date: Fri, 14 Mar 1997 11:48:05 -0800

attribute value literal

richard@c... wrote:

> If a default for an attribute value contains an entity reference, must
> the entity be declared before attribute list declaration?  I cannot
> see such a requirement, and I find this surprising since there *is*
> such a requirement for (parameter) references in entity declarations.


I'm not positive about the rules in XML, but in SGML
it _is_ necessary for the general entity declaration 
to appear first, as near as I can tell.  (SGMLS agrees)

By productions [143], [147], [33], and [34], the default
value in an attribute definition is parsed as replaceable
character data, which means that general entity references
are recognized and replaced, and the rule that entities
must be declared before they are referenced applies.

[ Another, erm, interesting fact is that parameter entity
references are _not_ replaced in attribute value literals
in ATTLIST declarations.  E.g.:

	<!ENTITY % e1 "foo">
	<!ENTITY % e2 "%e1;"		-- %e1; is expanded here -->
	<!ATTLIST %e1;			-- and here -->
	    A1 CDATA #FIXED %e1;	-- and here --
	    A2 CDATA #FIXED "%e1;"	-- but not here! --
	>

I've been fooled by this more than once... ]


--Joe English

  jenglish@c...


[143] attribute definition (11.3, 421:1) =
        ( attribute name [144],
          +ps [65],
          declared value [145],
          +ps [65],
          default value [147] )

[147] default value (11.3.4, 425:1) =
        ( ( ?( rni ("#"),
               "FIXED",
               +ps [65] ),
            attribute value specification [33] )
        | ( rni ("#"),
            ( "REQUIRED"
            | "CURRENT"
            | "CONREF"
            | "IMPLIED" ) ) )

[33] attribute value specification (7.9.3, 331:1) =
        ( attribute value [35]
        | attribute value literal [34] )

[34] attribute value literal (7.9.3, 331:4) =
        ( ( lit ("\""),
            replaceable character data [46],
            lit ("\"") )
        | ( lita ("'"),
            replaceable character data [46],
            lita ("'") ) )

xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo@i... the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa@i...)


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.