Skip to content

Minimize DTD sybsystem - #5742

Open
alfsb wants to merge 2 commits into
php:masterfrom
alfsb:minimize-dtd
Open

Minimize DTD sybsystem#5742
alfsb wants to merge 2 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
@@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>

@lacatoire lacatoire Aug 7, 2026

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.

this file is still referenced in docbookcs.xml:26

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.

In theory, this file still exists in translations, more so on the more than one with decade old outdated files. In this case, should they be removed as they are removed from doc-en, should they be removed only when all translations are updated (a.k.a., never) ?

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.

Translations don't actively use docbook-cs.xml from what I am aware of. True that they may use entities files that doc-en has ditched, but it's perfectly fine if they manage their own paths for what's still relevant to them.

So IMHO better to remove it.


<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.

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