[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: More questions about conformance and entities
>So that would apply similarly to: > >Doc1.dtd >======== ><!ENTITY % e "<!ELEMENT foo "> ><!ENTITY % f "%e;(#PCDATA)*>"> > >and: > >Doc2.dtd >======== ><!ENTITY % e "<!ELEMENT foo "> ><!ENTITY % f "(#PCDATA)*>"> ><!ENTITY % g "%e;%f;"> > >but not: > >Doc3.dtd >======== ><!ENTITY % e "<!ELEMENT foo "> ><!ENTITY % f "(#PCDATA)*>"> >%e;%g; > >Which is a violation. Is that right? Yes. >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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|