Project

Profile

Help

Bug #5022

The entity "nbsp" was referenced, but not declared

Added by O'Neil Delpratt 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Category:
PHP API
Start date:
2021-06-11
Due date:
% Done:

0%

Estimated time:
Found in version:
1.2.1
Fixed in version:

Description

A user has reported an issue in Saxon/C PHP where they cannot reference the entity file to the Schema Validator. See report here: https://stackoverflow.com/questions/67935660/saxon-php-xml-schema-validation-with-entity-reference

History

#1 Updated by Michael Kay 3 months ago

I'm afraid O'Neil and I both barked up a lot of wrong trees before realising this is a simple user error. The DTD has

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE section [
<!ENTITY % ent1 SYSTEM "isonum.ent">
]>

which declares a parameter entity ent1 but never references it. If you want to expand the DTD to include the declarations contained in the parameter entity, you need to expand the parameter entity by referring to it, that is:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE section [
<!ENTITY % ent1 SYSTEM "isonum.ent">
%ent1;
]>

With this change, the problem goes away.

I'm afraid we're getting rusty on remembering how DTDs work - we don't use them very often these days, partly because so many XML parsers don't support them fully.

Please register to edit this issue

Also available in: Atom PDF