OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] More questions about conformance and entities

[ Lists Home | Date Index | Thread Index ]

>So that would apply similarly to:
><!ENTITY % e "<!ELEMENT foo ">
><!ENTITY % f "%e;(#PCDATA)*>">
><!ENTITY % e "<!ELEMENT foo ">
><!ENTITY % f "(#PCDATA)*>">
><!ENTITY % g "%e;%f;">
>but not:
><!ENTITY % e "<!ELEMENT foo ">
><!ENTITY % f "(#PCDATA)*>">
>Which is a violation. Is that right?


>If so it makes me think that there 
>is no reason whatsoever to process the contents of a parameter entity 
>literal until it is referenced in markup (e.g. between markup decls, 
>part of a content spec).

When an internal parameter entity is defined, you should scan the
entity value for:

 - character references (which you replace)
 - parameter entity references (which you replace and rescan, following
   these same rules)
 - general entity references (which you check for syntactic correctness,
   rejecting &*; for example, but don't replace).

In theory you should check that an entity reference isn't to an
unparsed entity, but since you may not have seen the entity
declaration yet you might as well leave it until the reference would
be replaced (which can only be during the parsing of the instance, or
during the validation of an attribute default value).

-- Richard


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS