docs/59044: does not properly handle a source document already in XML format.

Michael Edenfield kutulu at
Fri Nov 7 22:40:12 UTC 2003

>Number:         59044
>Category:       docs
>Synopsis: does not properly handle a source document already in XML format.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 07 14:40:09 PST 2003
>Originator:     Michael Edenfield
>Release:        FreeBSD 5.1-CURRENT i386
System: FreeBSD wombat.localnet 5.1-CURRENT FreeBSD 5.1-CURRENT #7: Sun Aug 24 21:35:57 EDT 2003 root at wombat.localnet:/usr/obj/usr/src/sys/ATHLON i386


The documentation project makefiles are set up to allow the author
to apply XSL stylesheets instead of DSSSL stylesheet, and to use
DocBook 4.2 in XML format.  However, the makefiles assume that the
source document is in SGML format and needs to be converted to XML
format first.

This step itself is actually broken, as it assumes the document
has a root node of <book>, which is not always the case.  As it
stands, there's no way around this problem because using a pre-
make XML file fails for the reason below.

If the source document is already in XML format, this step is not
needed, and in fact causes a cyclic dependancy of the master
document on itself.

With this patch applied, one can use either the XML or SGML forms
of the DocBook DTD.

The patch also fixes a bug in the XSLT processing which fails to 
generate the HTML.manifest document, even though it assumes the 
file is present during `make clean` and while running tidy.

--- Makefile:
DOC= article
SRCS= article.xml
.include "/usr/doc/share/mk/"

~: $ make
Graph cycles through article.xml.


--- docbook.patch begins here ---
---	Thu Oct  2 15:46:49 2003
+++	Fri Nov  7 17:19:50 2003
@@ -349,7 +349,11 @@
 .if (${STYLESHEET_TYPE} == "xsl")
+.if ${DOCBOOKSUFFIX} != "xml"
 CLEANFILES+= ${DOC}.xml .sxerr
+CLEANFILE+= .sxerr
 .if (${LOCAL_CSS_SHEET} != ${CSS_SHEET}) && \
@@ -421,10 +425,14 @@
 # Better approaches to handling this would be most welcome
+# If our master doc is already ${DOC}.xml then we don't need this next 
+# part.  In fact, it causes a circular graph reference.
+.if ${DOCBOOKSUFFIX} != "xml"
 ${DOC}.xml: ${SRCS}
 	echo '<!DOCTYPE book SYSTEM "/usr/local/share/xml/docbook/4.2/docbookx.dtd">' > ${DOC}.xml
 	${SX} -xlower -xndata ${MASTERDOC} 2> .sxerr | tail -n +2 >> ${DOC}.xml 
 	@-grep -v 'reference to internal SDATA entity' .sxerr
 # HTML-SPLIT -------------------------------------------------------------
@@ -436,8 +444,8 @@
 .elif ${STYLESHEET_TYPE} == "xsl"
 index.html: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
-	${XSLTPROC} --param freebsd.output.html.images "'1'" ${XSLHTMLCHUNK} \
-		${DOC}.xml
+	${XSLTPROC} --param generate.manifest "'1'" --param freebsd.output.html.images "'1'" \
 .if !defined(NO_TIDY)
 	-${TIDY} ${TIDYOPTS} $$(${XARGS} < HTML.manifest)
--- docbook.patch ends here ---


More information about the freebsd-doc mailing list