XML宣言の誤りとそれによるビルド失敗を修正 #140
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
libxmlのバージョンにより、日本語ドキュメントのビルドが必ず失敗するのを修正しました。詳細
修正前のXML宣言は:
このように書かれていました。しかし:
以上の通り バージョン番号として有効なのは現在
1.0と1.1のみ です。この誤記は、
phpにリンクされたlibxmlのバージョンが比較的古い場合は問題にはなりません。GitHub Actions上のPHPも2.9.14という2年ほど前にリリースされたバージョンが使われているため、まだエラーには至っていません。しかし、これら誤ったバージョン表記に対し、libxml側では1年ほど前にエラーチェックが実装されました。以降のバージョンでは、冒頭のような誤った書き方は次のエラーメッセージと共にパース失敗します:
これは
libxmlからの出力です。リンクされたバージョンは次のとおりです:日本語訳で
"2.0"とされた理由は不明ですが、オリジナルの英語版では、初版より一貫して"1.0"と宣言されています。それに習うことで、上述の環境でビルド成功することを確認しました。
補足
現在、このリポジトリや php/doc-base のCIでは、これとは別の原因で日本語を含む幾つかのマルチバイト言語圏のビルドがエラーを出力しています。これらはPull Requestで言及されているlibxmlの最新バージョンでは発生せず、全ファイル、ビルド成功します。