Skip to content

Fix unresolved exception ZMQ entity references - #5776

Open
jordikroon wants to merge 1 commit into
php:masterfrom
jordikroon:unresolved-references-zmq
Open

Fix unresolved exception ZMQ entity references#5776
jordikroon wants to merge 1 commit into
php:masterfrom
jordikroon:unresolved-references-zmq

Conversation

@jordikroon

Copy link
Copy Markdown
Member

A few more follow-up MRs to come. The main goal is to bring docbook-cs to a state where it reports no unresolved entities.
These errors are caused by incorrect or outdated references.

I have not verified whether the synopsis is correct; that is out of scope.

@alfsb

alfsb commented Aug 19, 2026

Copy link
Copy Markdown
Member

What entities is docbook-cs not detecting? DTD entity references, or the targets of XPointers, or other cases?

It's important to note that changing DTD entity references around will change the final XML structure, so XPointers need to be also changed, and that is ok. But changing DTD entities around to fix unresolved entities appear to be a form of loading order mismatch. So to be sure:

  1. DTD entity references are resolved on a "first" pass, before anything else;
  2. Any resolved DTD entity referenced restart the process; or
  3. Each entity content is further expanded before being replaced in text.

This is the "macro order" or "tree building algorithm" of HTML, that I think that xmllib does, while assembling the manual. But the more general question is why docbook-cs is hitting undefined entities that libxml does not.

@jordikroon

Copy link
Copy Markdown
Member Author

So the exact errors for this PR are:

FILE: reference/zmq/zmqcontextexception.xml
-------------------------------------------
   89 | ERROR   | DocbookCS.Internal | XML parse error: Entity 'reference.zmq.entities.zmqcontextexception' not defined
-------------------------------------------

FILE: reference/zmq/zmqdeviceexception.xml
------------------------------------------
   89 | ERROR   | DocbookCS.Internal | XML parse error: Entity 'reference.zmq.entities.zmqdeviceexception' not defined
------------------------------------------

FILE: reference/zmq/zmqexception.xml
------------------------------------
   89 | ERROR   | DocbookCS.Internal | XML parse error: Entity 'reference.zmq.entities.zmqexception' not defined
------------------------------------

FILE: reference/zmq/zmqpollexception.xml
----------------------------------------
   89 | ERROR   | DocbookCS.Internal | XML parse error: Entity 'reference.zmq.entities.zmqpollexception' not defined
----------------------------------------

FILE: reference/zmq/zmqsocketexception.xml
------------------------------------------
   89 | ERROR   | DocbookCS.Internal | XML parse error: Entity 'reference.zmq.entities.zmqsocketexception' not defined
------------------------------------------

The real reason libxml doesn't catch these errors is because these files are never loaded by the manual. They were absent in reference/zmq/book.xml which had to be registered. Once done it would have given similar results.

The XPointer changes are a side effect of the files being loaded. Docbook-cs doesn't check. configure.php does.
In total there were 35 violations of undefined entities across the manual, which I have covered in this and follow up PRs.

As a side note, I am planning to load doc-base/temp/doctype.dtd instead (it contains all entities as you mentioned in php/doc-base#321). In order to be 100% sure about the order. But the errors reported here would still be triggered.

@alfsb

alfsb commented Aug 21, 2026

Copy link
Copy Markdown
Member

The real reason libxml doesn't catch these errors is because these files are never loaded by the manual. They were absent in reference/zmq/book.xml which had to be registered. Once done it would have given similar results.

Ah, you found out files not included in XML assembly. That was unexpected.

As a side note, I am planning to load doc-base/temp/doctype.dtd instead (it contains all entities as you mentioned in php/doc-base#321). In order to be 100% sure about the order. But the errors reported here would still be triggered.

Please, do. doc-base 321 is now merged. I will wait for the manual to build and publish before erasing the PR branch, but I expect the change will build ok. After this settles, then all loading of DTD files can be replaced by the loading of doc-base/temp/doctype.dtd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants