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

Re: Non-Validating XML Parsers: Requirements

  • From: John Cowan <cowan@l...>
  • To: XML Dev <xml-dev@i...>
  • Date: Mon, 03 Aug 1998 16:16:22 -0400

Re: Non-Validating XML Parsers: Requirements
Chris Hubick wrote:

>         Meaning, it MUST check ALL the well formedness constraints, and
> MAY check validity constraints.

Correct.
 
>         default attribute values...mmm...that is what I am coding today
> :-)  If an attribute is REQUIRED or IMPLIED, an NVP doesn't have to touch
> it or deal with it at all.  Otherwise an NVP must check if there is a
> value for an attribute and if not, include the default value. If the
> attribute is FIXED, an NVP is not required to check if the instance value
> matches the declared value because that is a validity constraint.

So far so good.

> This means that if you supply an instance value for a FIXED attribute,
> where that instance differs from the declared fixed value, that an NVP
> MAY (if it supports the Fixed Attribute Default VC) or MAY NOT supply the
> correct declared value for this attribute.

That's not clear.  It is an error for the document to supply a value
other than the FIXED one, so the parser may return the FIXED value,
or the application's value, or make demons fly out of your nose.
(See previous posting, or comp.std.c++).

> > 5.  An NVP MUST NOT process attribute list and entity declarations that
> > logically follow references to any parameter entities that have not
> > been read by the NVP.  As usual, everything in the external
> > DTD subset logically follows everything in the internal DTD subset.
> 
> Feed the following document to an NVP which doesn't read any external
> entities:
> 
> <!DOCTYPE Test [
>   <!ENTITY % xx SYSTEM 'file.ent'>
>   <!ENTITY yy '2 %xx; 3'>
>   <!ENTITY zz '1 &yy; 4'>
> ]>
> <Test>A &yy; B &zz; C</Test>

This document is not WF, and every parser should detect it (but
some do not), to wit:  parameter entity references in the internal
subset can only come between declarations, not within one.
See clause 2.8, the WF constraint called "PEs in Internal Subset".

If you move the DTD into the external subset, then the result
is unclear to me.  I suspect that any parser that reads the
external subset is compelled to read external parameter entities
as well, so that the result is

	<Test>A 2 [whatever] 3 B 1 2 [whatever] 3 4 C</Test>
 
> When I feed this to AElfred (file.ent doesn't
> actually exist), it gives me "A    3 B 1    3 4 C",  which I think must be
> a bug.

It's a bug in that Aelfred should throw an error.

> XP throws an exception "parameter entity reference in entity value
> in internal subset", which means that it processed the declaration
> (correctly?)

That is the correct action.

> the thing here is the table in section 4.4 of the spec
> says that PE's are not recognized in content, so I thought XP would have
> passed right over this?

Entity values are not the same thing as "content", which means
literally the stuff within elements.  Parameter entity references
are allowed within (internal) entity values, general or parameter,
but only if the entities in question are defined within the
external subset.  See clause 4.4.5.  (Note that the following
example is in error: "&YN;" should read "%YN;".)  The table in
4.4 repays careful study.

-- 
John Cowan	http://www.ccil.org/~cowan		cowan@c...
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto: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.