Re: [xsl] Tracking entity references

Subject: Re: [xsl] Tracking entity references
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Mar 2023 10:33:06 -0000
You have to dive in at a lower level than XSLT, because as you say, XSLT only
sees the document after all XML entities have been resolved by the XML
parser.

In the Java world, a SAX parser will report entity boundaries to the
LexicalHandler -

https://docs.oracle.com/javase/8/docs/api/org/xml/sax/ext/LexicalHandler.html
#startEntity-java.lang.String-

Well some of the entity boundaries anyway. It doesn't report entity boundaries
within attribute values.

Michael Kay
Saxonica

> On 28 Mar 2023, at 11:23, Wegmann, Frank frank.wegmann@xxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> This may be a very silly question, but I couldnbt find an answer on it,
with Saxon, or outside it, using tools relying on expat.
>
> Use case is a set of old XML documents (traditional, inhouse DTD) that make
overly excessive use of entities of all kinds. While it is easy to get all
entity declarations, and also to locate references of external entities, I
could not locate references of text entities. By the time I see it the entity
reference has already been resolved. How can I achieve that (ideally with
line/column of the actual place in the original file or entity)?
>
> I very much hope that I just overlooked something here...
>
> Thanks,
> Frank Wegmann
> Software AG
>
>
>
> Software AG b Sitz/Registered office: UhlandstraCe 12, 64297 Darmstadt,
Germany b Registergericht/Commercial register: Darmstadt HRB 1562 -
Vorstand/Management Board: Sanjay Brahmawar (Vorsitzender/Chairman), Daniela
BC<nger, Joshua Husk, Dr. Benno Quade, Dr. Stefan Sigg -
Aufsichtsratsvorsitzender/Chairman of the Supervisory Board: Christian Lucas -
https://www.softwareag.com <https://www.softwareag.com/>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> (by
email <>)

Current Thread