<?xml version="1.0" encoding="UTF-8"?> <project name="test01" default="xslt" basedir="."> <description>Simple example build file</description> <property name="BUILD" location="build"/> <property name="SRC" location="src"/> <property name="DOCBOOK_PUBLIC_ID" value="-//OASIS//DTD DocBook XML V4.5//EN"/> <property name="DOCBOOK_DTD" value="/usr/share/sgml/docbook/xml-dtd-4.5/docbookx.dtd"/> <target name="init" description="initialize"> <tstamp/> <mkdir dir="${BUILD}"/> </target> <target name="xslt" depends="init"> <xslt basedir="${SRC}" destdir="${BUILD}" extension=".html" style="${SRC}/test.xsl"> <xmlcatalog> <dtd publicId="${DOCBOOK_PUBLIC_ID}" location="${DOCBOOK_DTD}"/> </xmlcatalog> </xslt> </target> <target name="clean" description="clean up"> <delete dir="${BUILD}"/> </target> </project>これを実行すると ClassNotFoundException でエラーとなる
$ ant Buildfile: build.xml init: xslt: [xslt] java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.TraXLiaison
追加インストール
# yum install ant-traxこれで実行可能となる
$ ant Buildfile: build.xml init: xslt: [xslt] Transforming into /home/username/test01/build [xslt] Processing /home/username/test01/src/test.xml to /home/username/test01/build/test.html [xslt] Loading stylesheet /home/username/test01/src/test.xsl BUILD SUCCESSFUL Total time: 0 secondsSAXON を使った build.xml の作成手順は SAXSON を参照
0 件のコメント:
コメントを投稿