[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Entity references


Subject: Re: [xsl] Entity references
From: Michel Hendriksen <michel.hendriksen@xxxxx>
Date: Tue, 8 Jan 2013 13:16:38 +0100

Hi all,

Did some tests to no avail. To restate, I want to read an XML document
for which I have no DTD. I don't want to validate against the DTD, but
I do want to report errors on non-standard built in entity references
(like &eacute;).

So,

If I have no DTD in the XML all is ok, references are reported
if I have a DTD in the XML and validate, its all ok. (when DTD available)
if i have DTD and don't validate/load external DTD, there are no
reports on entity references.

I can add an EntityResolver, but that can only redirect to an exisitng
DTD. When redirecting to an empty DTD I get messages on undefined
elements (it 'finds' a DTD but elements in the XML are not defined in
there.)

I tried adding a LexicalHandler and not validate (otherwise, see
above), but start-/endEntity is not called in that case.

So one option would be to have an 'open' DTD definition with something like

<!ELEMENT Root ANY>

Which seems also not possible as all elements must be defined in the DTD.

Anything I overlooked or other ideas?
Otherwise giving up on this...

Michel Hendriksen

On Fri, Jan 4, 2013 at 4:58 PM, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
> On 4 January 2013 14:57, Michel Hendriksen <michel.hendriksen@xxxxx> wrote:
>> Ok makes sense.
>>
>> What you are actually saying is that there is no way you can force
>> this to be an error, unless having a processor that would be willing
>> to do so?
>
> You could supply your own EntityResolver and catch it there, or a
> LexicalHandler, or have a look at 'Lexev' (
> http://andrewjwelch.com/lexev/) and handle it in xslt.
>
>
> --
> Andrew Welch
> http://andrewjwelch.com


Current Thread
Keywords
xml