Subject: Re: XML, XSLT, and NetBSD
To: None <netbsd-help@netbsd.org>
From: Eric Gillespie <epg@pretzelnet.org>
List: netbsd-help
Date: 09/24/2002 09:40:19
"Jeff Flowers" <jeffrey@jeffreyf.net> writes:

> Can anyone recommend an XSLT processor for NetBSD? Many seem to
> require Java and I would prefer not to have to deal with Java.

I use xltproc, installed from pkgsrc/textproc/libxslt.  Below is
the Makefile fragment i use.  xmllint is part of the libxml2
package.

# $Id: bsd.docbook.mk,v 1.3 2002/08/04 10:46:53 epg Exp $

# Programs
XMLLINT?=	xmllint
XSLTPROC?=	xsltproc

# Commands
MKHTML.xml?=	${XSLTPROC} --xinclude --nonet ${XSLTPROCFLAGS} ${XSL.html}
MKMAN.xml?=	${XSLTPROC} --xinclude --nonet ${XSLTPROCFLAGS} ${XSL.man}
VALIDATE.xml?=	${XMLLINT} --valid --postvalid --noent --noout \
		--xinclude ${XMLLINTFLAGS}

# Directories
XMLDIR?=	/usr/share/xml

# Files
XSL.html?=	${XMLDIR}/xsl/docbook/xhtml/docbook.xsl
XSL.man?=	${XMLDIR}/xsl/docbook/manpages/db2man.xsl

# Dependencies
HTMLDEPS?=	${XSL.html}
MANDEPS?=	${XSL.man}

# Rules

.SUFFIXES: .xml .html .1 .2 .3 .4 .5 .6 .7 .8 .9

.xml.html: ${HTMLDEPS}
	@echo "${MKHTML.xml} $< > $@"
	@${MKHTML.xml} $< > $@ || (rm -f $@; false)

.xml.9 .xml.8 .xml.7 .xml.6 .xml.5 .xml.4 .xml.3 .xml.2 .xml.1:
	@echo "${MKMAN.xml} $< > $@"
	@${MKMAN.xml} $< > $@ || (rm -f $@; false)

.xml.valid:
	${VALIDATE.xml} $<

validate: ${PROG}.valid

.if defined(BOOK)
all: ${BOOK}.html
validate: ${BOOK}.valid
.endif

.PHONY: validate

--  
Eric Gillespie <*> epg@pretzelnet.org

Build a fire for a man, and he'll be warm for a day.  Set a man on
fire, and he'll be warm for the rest of his life. -Terry Pratchett