Re: feature request
... I would still argue that conceptually entities are by design distinct from the document structure, they allow an author to split up the file as he or she pleases, without having any effect on the logical document.
I believe that's the point of view espoused by the XML 1.0 Recommendation, too. XML 1.0 has two big sections devoted to "what's in a document": Sections 3 (Logical Structures) and 4 (Physical Structures). Sec. 4 is pretty much exclusively to do with entities (declaring and referencing), which are mentioned in Sec. 3 only in passing.
Given that XML 1.0 defines the behavior of parsers, including the replacement of general/parsed entity references by whatever it is they represent, I really don't understand how someone can complain because a downstream application like XSLT fails to provide access to the unexpanded reference. I mean, I can understand why it's frustrating -- I just can't see that it makes logical sense to want (let alone expect) it to be otherwise. When I'm stuck in rush-hour traffic, I always am frustrated by the failure of other cars to be somewhere other than in my way; after all, they honor that desire when I'm sitting in the driveway, so what's the problem?
Now, unparsed entities are a whole other kettle of fish. But I can get at them all right, via their URIs. But general/parsed entities? The whole point of such an entity is that its "meaning" consists entirely of its replacement value.
Dave Pawson's original request (and Bob DuCharme's followup), as I understood it, was not about getting at the entity reference in the source tree -- rather about creating an entity declaration in the result. That, too, is another kettle of fish. It's not too hard to imagine an XSLT element like:
replacement-text="whatever, including *escaped* ent refs"
Maybe as a child of the (otherwise typically empty) xsl:output element....
================================================================ John E. Simpson | "I hate it when my foot falls asleep http://www.flixml.org | during the day because that means it's simpson@xxxxxxxxxxx | going to be up all night." (Steven Wright)
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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