@@ -67,8 +67,10 @@ function usage() // {{{
67
67
--with-php=PATH Path to php CLI executable [detect]
68
68
--with-lang=LANG Language to build [ {$ acd ['LANG ' ]}]
69
69
--with-partial=my-xml-id Root ID to build (e.g. <book xml:id="MY-ID">) [ {$ acd ['PARTIAL ' ]}]
70
- --disable-broken-file-listing Do not ignore translated files in
70
+ --disable-broken-file-listing Do not ignore translated files in
71
71
broken-files.txt
72
+ --disable-xpointer-reporting Do not show XInclude/XPointer failures. Only effective
73
+ on translations
72
74
--redirect-stderr-to-stdout Redirect STDERR to STDOUT. Use STDOUT as the
73
75
standard output for XML errors [ {$ acd ['STDERR_TO_STDOUT ' ]}]
74
76
--output=FILENAME Save to given file (i.e. not .manual.xml)
@@ -356,6 +358,7 @@ function generate_sources_file() // {{{
356
358
'INPUT_FILENAME ' => 'manual.xml ' ,
357
359
'TRANSLATION_ONLY_INCL_BEGIN ' => '' ,
358
360
'TRANSLATION_ONLY_INCL_END ' => '' ,
361
+ 'XPOINTER_REPORTING ' => 'yes ' ,
359
362
); // }}}
360
363
361
364
$ ac = $ acd ;
@@ -490,7 +493,11 @@ function generate_sources_file() // {{{
490
493
case 'stderr-to-stdout ' :
491
494
$ ac ['STDERR_TO_STDOUT ' ] = $ v ;
492
495
break ;
493
-
496
+
497
+ case 'xpointer-reporting ' :
498
+ $ ac ['XPOINTER_REPORTING ' ] = $ v ;
499
+ break ;
500
+
494
501
case '' :
495
502
break ;
496
503
@@ -710,14 +717,26 @@ function generate_sources_file() // {{{
710
717
print_xml_errors ();
711
718
errors_are_bad (1 );
712
719
}
713
-
714
720
echo "done. \n" ;
715
- echo "Validating {$ ac ["INPUT_FILENAME " ]}... " ;
721
+
722
+ echo "Running XInclude/XPointer... " ;
716
723
flush ();
717
724
718
725
$ dom ->xinclude ();
719
- print_xml_errors ();
720
726
727
+ echo "done. \n" ;
728
+ flush ();
729
+
730
+ if ( $ ac ['XPOINTER_REPORTING ' ] == 'yes ' || ($ ac ['LANG ' ] == 'en ' ) )
731
+ {
732
+ $ errors = libxml_get_errors ();
733
+ $ output = ( $ ac ['STDERR_TO_STDOUT ' ] == 'yes ' ) ? STDOUT : STDERR ;
734
+ foreach ( $ errors as $ error )
735
+ fprintf ( $ output , "{$ error ->message }\n" );
736
+ }
737
+
738
+ echo "Validating {$ ac ["INPUT_FILENAME " ]}... " ;
739
+ flush ();
721
740
if ($ ac ['PARTIAL ' ] != '' && $ ac ['PARTIAL ' ] != 'no ' ) { // {{{
722
741
$ dom ->validate (); // we don't care if the validation works or not
723
742
$ node = $ dom ->getElementById ($ ac ['PARTIAL ' ]);
0 commit comments