[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: entity definitions
On Mon, Apr 26, 2004 at 10:45:03AM +0100, David Carlisle wrote: > >There only seem to be examples of entity definition, none of entity >reference. The last example contains references. But the purpose isn't to change references, only to change definitions/declarations. >The thing that has killed all previous attempts to do this is that in >XML 1.0 (and 1.1) a reference to "& e a c u t e ;" results in a >non-wellformed document unless there is also a <!DOCTYPE and if you are >going to have a doctype declaration, you may as well define the entity >in dtd syntax. This proposal is intended to modify XML 1.0 by changing parts of section 4.1, specifically creating an alternative mechanism to fulfill the Entity Declared WF/V Constraint. I have probably not made this sufficiently clear, so I will provide text to update that section, allowing this alternate mechanism. >There was a request at XML 1.1 to make an undefined entity (that is, >undefined by dtd) a validity rather than WF error, exactly to allow this >kind of alternative syntax, but it wasn't accepted. Well, it's already possible, if you're not validating and standalone="no". Quoting from the final sentence of Well-Formedness Constraint: Entity Declared in section 4.1 of XML 1.0: "Note that if entities are declared in the external subset or in external parameter entities, a non-validating processor is not obligated to read and process their declarations; for such documents, the rule that an entity must be declared is a well-formedness constraint only if standalone='yes'." By definition, all entities declared via EDML are either external or part of the "external subset" (albeit for schema languages other than DTD). The first clause of the same paragraph, "In a document without any DTD" is problematic, potentially. *shrug* Bob Foster also suggested, in email, that it might be possible to use XSLT to perform a transformation (pick up the entity and entities PIs, and stick them in the external subset). I may need to ask on xsl-list, but I don't think that this is possible. On the other hand, it might be possible to generate an internal subset. But it isn't clear that the processor feeding the XSLT engine would leave the entities unexpanded (the general XSLT advice seems to be: you can't ever see an entity). So I need to ask some experts on xsl-list, but I'm doubtful whether there's an XSLT solution for integration. I'm currently investigating what it would take to make a generic SAX filter that would effectively act as a macro processor (this only handles the processing instruction in instance document case, though; the use of entity definitions in schema documents isn't addressed). Amy! -- Amelia A. Lewis amyzing {at} talsever.com Igne natura renovatur integra.
|
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
|