|
16 | 16 | | Authors: Dave Barr <[email protected]> |
|
17 | 17 | | Hannes Magnusson <[email protected]> |
|
18 | 18 | | Gwynne Raskind <[email protected]> |
|
| 19 | + | André L F S Bacci <[email protected]> | |
19 | 20 | +----------------------------------------------------------------------+
|
20 | 21 | */
|
21 | 22 |
|
@@ -780,17 +781,20 @@ function dom_saveload( DOMDocument $dom , string $filename )
|
780 | 781 |
|
781 | 782 | echo "Loading and parsing {$ac["INPUT_FILENAME"]}... ";
|
782 | 783 |
|
783 |
| -if ( ! dom_load( $dom , "{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}" ) ) |
| 784 | +if ( dom_load( $dom , "{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}" ) ) |
784 | 785 | {
|
785 |
| - echo "failed.\n"; |
786 |
| - print_xml_errors(); |
787 |
| - errors_are_bad(1); |
| 786 | + if ( ! file_exists( __DIR__ . "/temp" ) ) |
| 787 | + mkdir( __DIR__ . "/temp" , true ); //TODO remove after #200, aldo clean up flush(), header |
| 788 | + |
| 789 | + // Correct file/line/column on error messages |
| 790 | + dom_saveload( $dom , __DIR__ . "/temp/manual.xml" ); |
| 791 | + echo "done.\n"; |
788 | 792 | }
|
789 | 793 | else
|
790 | 794 | {
|
791 |
| - // So that file/line/column makes sense on error messages |
792 |
| - dom_saveload( $dom , __DIR__ . "/temp/manual.xml" ); |
793 |
| - echo "done.\n"; |
| 795 | + echo "failed.\n"; |
| 796 | + print_xml_errors(); |
| 797 | + errors_are_bad(1); |
794 | 798 | }
|
795 | 799 |
|
796 | 800 | echo "Running XInclude/XPointer... ";
|
@@ -893,13 +897,21 @@ function xinclude_report()
|
893 | 897 | $count = 0;
|
894 | 898 | $prefix = realpath( __DIR__ );
|
895 | 899 |
|
| 900 | + $prevLine = -1; |
| 901 | + $prevClmn = -1; |
| 902 | + |
896 | 903 | foreach( $errors as $error )
|
897 | 904 | {
|
898 | 905 | $msg = $error->message;
|
899 | 906 | $file = $error->file;
|
900 | 907 | $line = $error->line;
|
901 | 908 | $clmn = $error->column;
|
902 | 909 |
|
| 910 | + if ( $prevLine == $line && $prevClmn == $clmn ) |
| 911 | + continue; // XPointer failures double reports sometimes |
| 912 | + $prevLine = $line; |
| 913 | + $prevClmn = $clmn; |
| 914 | + |
903 | 915 | $msg = rtrim( $msg );
|
904 | 916 | if ( str_starts_with( $file , $prefix ) )
|
905 | 917 | $file = substr( $file , strlen( $prefix ) + 1 );
|
|
0 commit comments