[DOC-CVS] [doc-base] master: Relax IDREF failures of libxml validation on translations (#333)

[email protected] (alfsb via GitHub) Tue, 28 Jul 2026 16:57:18 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: alfsb (alfsb)
Committer: GitHub (web-flow)
Pusher: jordikroon
Date: 2026-07-28T18:57:15+02:00

Commit: https://github.com/php/doc-base/commit/c779642bd4519797c667780a2bcef6e4b6d1661e
Raw diff: https://github.com/php/doc-base/commit/c779642bd4519797c667780a2bcef6e4b6d1661e.diff

Relax IDREF failures of libxml validation on translations (#333)

Co-authored-by: AndrĂ© L F S Bacci <[email protected]>

Changed paths:
  M  configure.php


Diff:

diff --git a/configure.php b/configure.php
index 52255a0544..0c89f4b775 100755
--- a/configure.php
+++ b/configure.php
@@ -1057,10 +1057,23 @@ function xml_validate_jing()
 function xml_validate_libxml( $dom )
 {
     echo "Validating temp/manual.xml (libxml)... ";
+    $ok = $dom->relaxNGValidate( RNG_SCHEMA_FILE );
 
-    if ( $dom->relaxNGValidate( RNG_SCHEMA_FILE ) )
+    if ( ! $ok && $GLOBALS['ac']['LANG'] != 'en' )
+    {
+        $errors = libxml_get_errors();
+        $warnings = 0;
+        foreach( $errors as $error )
+            if ( str_contains( $error->message , 'IDREF attribute' ) )
+                $warnings++;
+        if ( count( $errors ) == $warnings )
+            $ok = true;
+    }
+
+    if ( $ok )
     {
         echo "done.\n";
+        print_xml_errors();
     }
     else
     {