Entity expansion is done by the XML parser, not by the XSLT processor.
The XML parser processes the source document and the stylesheet quite
independently of each other, before the XSLT processor gets a look in.
Therefore, there is no way that entity definitions in the stylesheet can
affect entity expansion in the source document.
If you want to expand things in the source document using definitions in
the stylesheet, you should represent the "things" as elements or
processing instructions, and then write template rules in the stylesheet
to do the expansion. Or if you want to be clever, you can use entity
references in the source document, which are expanded to elements or
processing instructions by means of an entity declaration in the source
document's DTD, which are then processed by the stylesheet.
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of
> Richard Gartner
> Sent: 21 August 2003 15:09
> To: saxon-help@...
> Subject: [saxon] Entities in stylesheet file
> Can anyone help? I think I should be able to declare
> character entities in a DOCTYPE declaration in my
> stylesheet (at least that's what umpteen websites say). But
> when I try to run Saxon having done that, it doesn't
> recognise any entities in the xml file, even if they are
> declared in the stylesheet.
> Am I doing anything very obviously wrong here, or does
> Saxon require the entities to be declared in the xml file
> itself? If that's the case, what alternative to Saxon would
> people suggest which can handle entities in the stylesheet?
> Many thanks
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a
> single machine. WITHOUT REBOOTING! Mix Linux / Windows /
> Novell virtual machines at the same time. Free trial click
> saxon-help mailing list
> https://lists.sourceforge.net/lists/listinfo/s> axon-help