diff --git a/make-includes/standard_rules.make b/make-includes/standard_rules.make index 16e331c..f4be5f0 100755 --- a/make-includes/standard_rules.make +++ b/make-includes/standard_rules.make @@ -48,8 +48,22 @@ # # Derived XML with inclusions from source XML without inclusions. # +# This is done by simply running the original source through xmllint +# with the --xinclude option to process any xi:include elements. +# The result of this could just be piped into the XSLT processor, +# except that (a) not all of the processors support input from stdin, +# and (b) combining both xmllint and XSLT processing into one command +# means that make won't stop if there's any errors from xmllint. +# +# Sed is used to add a comment to the derived XML file, warning that this +# is generated and shouldn't be edited. Sed was used because the +# processing instruction MUST be on the first line. The implication here +# is that all input source files have an processing instruction +# (which they should anyway). +# %-derived.xml: %.xml xmllint --xinclude $< > $@ + @sed -i -e '1a ' $@ # # LaTeX from derived XML. #