Skip to content

Minimize DTD sybsystem - #5742

Merged
alfsb merged 3 commits into
php:masterfrom
alfsb:minimize-dtd
Aug 13, 2026
Merged

Minimize DTD sybsystem#5742
alfsb merged 3 commits into
php:masterfrom
alfsb:minimize-dtd

Conversation

@alfsb

@alfsb alfsb commented Aug 6, 2026

Copy link
Copy Markdown
Member

The doc-en side of DTD subsystem minimization.

Convert language-defs.ent into XML, and rewrite manual.xml to use the minimized DTD configuration. Also in manual.xml:

  • Root <set> namespaces is reorganized,
  • Some xmlns re-declarations removed;
  • funcindex.xml is embedded, so &global.function-index; is not necessary anymore.

This PR depends on the PR with the same name on the doc-base side.

Comments and reviews are welcome. Plan to merge this in one week.

Comment thread language-defs.ent
Comment thread entities/entities.title.ent Outdated

<entity name="AuthenticationServices">Authentication Services</entity>

<entity name="CalendarandEventRelatedExtensions">Date and Time Related

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some have gain a \n, is it intended ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is intended, and it is ugly. There are a few lines that pass the 80 column marker. I'm considering removing the breaks, as this file is still (and forever will be?) small.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have purposely broken that rule in Acronyms.ent as well for the same reason. So I have absolutely no problem if this rule will be broken here.

@alfsb

alfsb commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

The failures are expected, for now. The other PR on doc-base, that will be merged first, rename some doc-base/temp/ files and extensions.

The only remaining DTD entity files left are doc-base/entities/global.ent and doc-lang/language-snippets.ent.

The first one is to be simply erased after more changes are sent indo doc-base/configure.php, and the last one may linger for a while.

After XML trim lands, all these <entities> loading should be replaced by a single and stable <file>../doc-base/temp/doctype.dtd</file>.

Comment thread manual.xml
]>

<set xmlns="http://docbook.org/ns/docbook" version="5.2" xml:id="index" xml:lang="&LANG;" xmlns:xlink="http://www.w3.org/1999/xlink">
<set xml:id="index" xml:lang="" version="5.2"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to hardcode "en" instead of leaving xml:lang empty?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ideia is to it always be filled, by API instead of by entity: https://github.com/php/doc-base/pull/336/files#diff-72f941dd66490c5d4d1315814f9ba8c7cd1329fce421907e5716156718527235R733

The code is in crude form, because I was to merge Trim PR first, then the other PR. But I delayed, I will change this line to consider $ret. &LANG; is still being generated so nothing breaks at first.

Hard coding with "en" may cause a future failure to be silently ignored.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, note that --with-base-lang=extensions is creating Docbook files with root element marked as xml:lang=extensions", because the long standing convention of configure.php, where LANG means "language directory named with a valid BCP 47 language tag".

So, for example, doc-extensions/manual.xml can hard code xml:lang as "en", but the main manual leaves it empty, and the code only fills this attribute from LANG if it is currently empty.

@alfsb
alfsb merged commit c9e22e4 into php:master Aug 13, 2026
1 of 4 checks passed
@alfsb
alfsb deleted the minimize-dtd branch August 13, 2026 18:59
@alfsb

alfsb commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Post tested, all languages build and validate. Let me know if there is some issue.

Next in line is XML trim, userland XML assembler and a few more rounds of configure.php modernization, after a small vacation.

XML trim, in particular, will take time, until I borrow a Windows machine to test it, or to learn enough about Windows images in docker or GH CI as a substitute.

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.

3 participants