From 26f4b94f99918c8ae3bb1b12dbc48158d2b1a176 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 3 Jun 2009 10:12:44 +0000 Subject: [PATCH] Tighten up the DocBook XSL stylesheet test It wasn't failing even when the DTD was not found. --- aclocal.m4 | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index d614eff..13ebe36 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -747,14 +747,28 @@ AS_VAR_POPDEF([fp_func])dnl # FP_GEN_DOCBOOK_XML # ------------------ # Generates a DocBook XML V4.2 document in conftest.xml. +# +# It took a lot of experimentation to find a document that will cause +# xsltproc to fail with an error code when the relevant +# stylesheets/DTDs are not found. I couldn't make xsltproc fail with +# a single-file document, it seems a multi-file document is needed. +# -- SDM 2009-06-03 +# AC_DEFUN([FP_GEN_DOCBOOK_XML], -[rm -f conftest.xml +[rm -f conftest.xml conftest-book.xml cat > conftest.xml << EOF + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [[ + +]]> - A DocBook Test Document +&conftest-book; + +EOF +cat >conftest-book.xml << EOF + + A DocBook “Test Document” A Chapter Title This is a paragraph, referencing . @@ -763,7 +777,6 @@ cat > conftest.xml << EOF Another Chapter Title This is another paragraph, referencing . - EOF ]) # FP_GEN_DOCBOOK_XML @@ -793,11 +806,9 @@ fi ])# FP_PROG_XSLTPROC -# FP_DOCBOOK_XSL(XSL-DIRS) +# FP_DOCBOOK_XSL # ---------------------------- -# Check which of the directories XSL-DIRS contains DocBook XSL stylesheets. The -# output variable HAVE_DOCBOOK_XSL will contain the first usable directory or -# will be empty if none could be found. +# Check that we can process a DocBook XML document to HTML using xsltproc. AC_DEFUN([FP_DOCBOOK_XSL], [AC_REQUIRE([FP_PROG_XSLTPROC])dnl if test -n "$XsltprocCmd"; then @@ -838,7 +849,7 @@ AC_DEFUN([FP_CHECK_DOCBOOK_DTD], if test -n "$XmllintCmd"; then AC_MSG_CHECKING([for DocBook DTD]) FP_GEN_DOCBOOK_XML - if $XmllintCmd --nonet --valid --noout conftest.xml > /dev/null 2>&1; then + if $XmllintCmd --nonet --valid --noout conftest.xml ; then AC_MSG_RESULT([ok]) else AC_MSG_RESULT([failed]) -- 1.7.10.4