﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-Antony Lee的技术之路</title><link>http://www.blogjava.net/antony9/</link><description>步步为营</description><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 06:01:02 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 06:01:02 GMT</pubDate><ttl>60</ttl><item><title>DocBook与Eclipse - 教程</title><link>http://www.blogjava.net/antony9/archive/2011/08/07/355908.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Sat, 06 Aug 2011 18:00:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/08/07/355908.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/355908.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/08/07/355908.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/355908.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/355908.html</trackback:ping><description><![CDATA[<meta content="DocBook XSL-NS Stylesheets V1.76.1" name="generator" />
<div class="article" title="DocBook与Eclipse - 教程">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="N10001"></a>DocBook与Eclipse - 教程</h1>
</div>
<div>
<div class="authorgroup">
<div class="author">
<h3 class="author"><span class="firstname">Lars</span> <span class="surname">Vogel</span></h3>
</div>
<div class="author">
<h3 class="author"><span class="othername">李墨耘</span></h3>
<code class="email">&lt;<a class="email" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#108;&#105;&#109;&#111;&#121;&#117;&#110;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;">limoyun@gmail.com</a>&gt;</code></div>
</div>
</div>
<div>
<p class="copyright">Copyright &#169; 2007 - 2011 Lars Vogel</p>
</div>
</div>
<hr />
</div>
<div class="toc">
<p><strong>Table of Contents</strong></p>
<dl> <dt><span class="sect1"><a href="#N1001E">0. 翻译说明</a></span> </dt><dt><span class="sect1"><a href="#N1002D">1. DocBook介绍</a></span> </dt><dd> <dl> <dt><span class="sect2"><a href="#N10031">1.1. 概要</a></span> </dt><dt><span class="sect2"><a href="#N10055">1.2. 实例</a></span> </dt><dt><span class="sect2"><a href="#N1005F">1.3. 所需的工具</a></span></dt></dl> </dd><dt><span class="sect1"><a href="#N10078">2. 安装</a></span> </dt><dd> <dl> <dt><span class="sect2"><a href="#N1007C">2.1. Eclipse</a></span> </dt><dt><span class="sect2"><a href="#N10085">2.2. Docbook和样式表</a></span> </dt><dt><span class="sect2"><a href="#N10090">2.3. XSL处理器</a></span></dt></dl> </dd><dt><span class="sect1"><a href="#N10098">3. 把Docbook转换为HTML</a></span> </dt><dd> <dl> <dt><span class="sect2"><a href="#N1009C">3.1. 工程设置</a></span> </dt><dt><span class="sect2"><a href="#N100BB">3.2. 第一个Docbook文档</a></span> </dt><dt><span class="sect2"><a href="#N100C4">3.3. 使用Ant把Docbook转换为HTML格式</a></span></dt></dl> </dd><dt><span class="sect1"><a href="#N100CF">4. Docbook examples</a></span> </dt><dd> <dl> <dt><span class="sect2"><a href="#N100D5">4.1. 标签</a></span> </dt><dt><span class="sect2"><a href="#N1010D">4.2. 表格</a></span> </dt><dt><span class="sect2"><a href="#N1013A">4.3. 列表</a></span> </dt><dt><span class="sect2"><a href="#N1015D">4.4. 链接</a></span> </dt><dt><span class="sect2"><a href="#N10167">4.5. 插入图片</a></span></dt></dl> </dd><dt><span class="sect1"><a href="#N1016E">5. 创建pdf输出</a></span> </dt><dd> <dl> <dt><span class="sect2"><a href="#N10172">5.1. 安装</a></span> </dt><dt><span class="sect2"><a href="#N10184">5.2. 定义Ant Task</a></span></dt></dl> </dd><dt><span class="sect1"><a href="#N1018D">7. 控制输出格式</a></span> </dt><dd> <dl> <dt><span class="sect2"><a href="#N10192">7.1. HTML参数</a></span> </dt><dt><span class="sect2"><a href="#N101B8">7.2. 为html增加内容</a></span></dt></dl> </dd><dt><span class="sect1"><a href="#N101C7">7. 用Eclipse XSL完成XInclude功能</a></span> </dt><dd> <dl> <dt><span class="sect2"><a href="#N101CB">7.1. 概述</a></span> </dt><dt><span class="sect2"><a href="#N101DD">7.2. Eclipse XSL工具</a></span> </dt><dt><span class="sect2"><a href="#N101F0">7.3. 在Ant中使用XInclude</a></span></dt></dl> </dd><dt><span class="sect1"><a href="#N101F7">8. 相关链接</a></span></dt></dl></div>
<div class="sect1" title="0.&nbsp;翻译说明">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N1001E"></a>0. 翻译说明</h2>
</div>
</div>
</div>
<p>本文翻译自Lars Vogel的DocBook with Eclipse教程， <a class="link" href="http://www.vogella.de/articles/DocBook/article.html" target="_top">http://www.vogella.de/articles/DocBook/article.html</a> </p>
<p>在翻译过程中，本人保留原文的一切链接。 </p>
<p>原文一切权利归原作者所有，译文一切权利归本人所有。如欲转载原文，请征得作者授权。如欲转载译文，请注明本文原始链接。 </p>
<p>本文的翻译已获得原作者授权。 </p>
</div>
<div class="sect1" title="1.&nbsp;DocBook介绍">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N1002D"></a>1. DocBook介绍</h2>
</div>
</div>
</div>
<div class="sect2" title="1.1.&nbsp;概要">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10031"></a>1.1. 概要</h3>
</div>
</div>
</div>
<p>DocBook是一种文档标准，用以创建结构化的纯文本文档。用DocBook创建的文档能够方便的在不同的操作系统之间以及不同的文本处理 工具之间进行移植，并可以通过<a class="link" href="http://www.vogella.de/articles/XSLT/article.html" target="_top">XSLT</a> 转为其他的输出格式。<span class="emphasis"><em>XSLT</em></span>是E<span class="emphasis"><em>X</em></span>tensible <span class="emphasis"><em>S</em></span>tylesheet <span class="emphasis"><em>L</em></span>anguage <span class="emphasis"><em>T</em></span>ransformation的缩写。 由于DocBook是使用纯文本编辑的，因此你可以使用任何一个文本 编辑器来编写DocBook，并纳入版本控制系统的管理。 </p>
<p>目前，有多种不同的样式表，能够把DocBook文件转换为不同的输出格式，例如转换为HTML，pdf，java help以及Unix man pages. </p>
<p>DocBook有两种主要的文档，一种是book，另一种是article。其中 </p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
     <li class="listitem">
     <p>Article: 用来写一些技术文章，下文都以article为例。article通常是由一系列的section组成。</p>
     </li>
     <li class="listitem">
     <p>Book: 用来写一些更长的描述。book比article多了一种结构：chapter。</p>
     </li>
</ul>
</div>
<p>&nbsp;</p>
</div>
<div class="sect2" title="1.2.&nbsp;实例">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10055"></a>1.2. 实例</h3>
</div>
</div>
</div>
<p>下面就是一个DocBook文档的例子。 </p>
<pre class="programlisting">&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "../docbook-xml-4.5/docbookx.dtd"&gt;
&lt;article&gt;
&lt;articleinfo&gt;
&lt;title&gt;DocBook Intro&lt;/title&gt;
&lt;author&gt;
&lt;firstname&gt;Lars&lt;/firstname&gt;
&lt;surname&gt;Vogel&lt;/surname&gt;
&lt;/author&gt;
&lt;/articleinfo&gt;
&lt;sect1 label="1.0"&gt;
&lt;title&gt;An introduction to DocBook&lt;/title&gt;
&lt;para&gt;
This is text.
&lt;/para&gt;
&lt;/sect1&gt;
&lt;/article&gt;
</pre>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in">
<h3 class="title">Note</h3>
<p>请注意，在上面的例子中，DTD文件的位置：当前目录的上一级目录，其中的docbook-xml-4.5文件夹内。</p>
</div>
</div>
<div class="sect2" title="1.3.&nbsp;所需的工具">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N1005F"></a>1.3. 所需的工具</h3>
</div>
</div>
</div>
<p>想要创建DocBook文件并转换成其他格式，你需要以下工具： </p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
     <li class="listitem">
     <p>DocBook的DTD文件。这个文件定义了DocBook文档的格式。</p>
     </li>
     <li class="listitem">
     <p>XSLT样式表，用来把DocBook文档转换成其他格式。</p>
     </li>
     <li class="listitem">
     <p>XSLT解析器</p>
     </li>
</ul>
</div>
<p>我们使用<a class="link" href="http://www.vogella.de/articles/Eclipse/article.html" target="_top">Eclipse</a> 作为XML编辑器，Xalan作为XSLT解析器，并使用 <a class="link" href="http://www.vogella.de/articles/ApacheAnt/article.html" target="_top">Apache Ant</a> 来进行XSLT的转换。 </p>
</div>
</div>
<div class="sect1" title="2.&nbsp;安装">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N10078"></a>2. 安装</h2>
</div>
</div>
</div>
<div class="sect2" title="2.1.&nbsp;Eclipse">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N1007C"></a>2.1. Eclipse</h3>
</div>
</div>
</div>
<p>你需要安装Eclipse，可以参看这篇文章 <a class="link" href="http://www.vogella.de/articles/Eclipse/article.html" target="_top">Eclipse IDE</a> 来学习Eclipse的安装和使用。我们需要用到的Ant已经被集成到Eclipse里面了，因此关于Ant我们不需要安装任何额外的东西。 </p>
</div>
<div class="sect2" title="2.2.&nbsp;Docbook和样式表">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10085"></a>2.2. Docbook和样式表</h3>
</div>
</div>
</div>
<p>你还需要下载Docbook的DTD，以及用来转换的Docbook文档的样式表。Docbook的DTD可以在 <a class="link" href="http://www.oasis-open.org/docbook/xml/4.5" target="_top">http://www.oasis-open.org/docbook/xml/4.5</a>下载， 而XSLT样式表可以在 <a class="link" href="http://docbook.sourceforge.net/" target="_top">http://docbook.sourceforge.net/</a> 下载。在写这篇文档时，最新的版本是&#8220;1.75.2&#8221;（译者注：在翻译这篇文档时，最新的版本是1.76.1）。你需要下载的docbook-xsl的发布文件， 例如&#8220;docbook-xsl-1.75.2.zip&#8221;。 </p>
</div>
<div class="sect2" title="2.3.&nbsp;XSL处理器">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10090"></a>2.3. XSL处理器</h3>
</div>
</div>
</div>
<p>要命的是JVM自带的XSL处理器在处理XSLT样式表的时候有问题&#8230;&#8230;所以我们需要从 <a class="link" href="http://xml.apache.org/xalan-j/" target="_top">http://xml.apache.org/xalan-j/</a> 下载Xalan，用来作为我们的XSL处理器。 </p>
</div>
</div>
<div class="sect1" title="3.&nbsp;把Docbook转换为HTML">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N10098"></a>3. 把Docbook转换为HTML</h2>
</div>
</div>
</div>
<div class="sect2" title="3.1.&nbsp;工程设置">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N1009C"></a>3.1. 工程设置</h3>
</div>
</div>
</div>
<p>可以在Eclipse中，创建一个"de.vogella.docbook.first"的新工程，方法是File -&gt; New -&gt; Project，并从弹出的 窗口中选择General -&gt; Projects. </p>
<p>在工程中创建如下的目录结构： </p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
     <li class="listitem">
     <p>output : Docbook转换成其他格式时的输出目录</p>
     </li>
     <li class="listitem">
     <p>docbook-xml-4.5: 用来放Docbook的DTD定义文件</p>
     </li>
     <li class="listitem">
     <p>docbook-xsl: 用来放进行Docbook转换的样式表文件</p>
     </li>
     <li class="listitem">
     <p>lib: 用来包含你需要的库文件（用来创建pdf）</p>
     </li>
     <li class="listitem">
     <p>documents: 用来放你的DocBook文件</p>
     </li>
</ul>
</div>
<p>把DocBook的DTD和XSLT的样式表放入相应的文件夹中。 </p>
<p>在lib文件夹下创建xalan文件夹，并把xalan相关的jar包拷入这个文件夹中。 结果应该看起来是这样的： </p>
<div class="mediaobject"><a href="http://www.blogjava.net/images/blogjava_net/antony9/WindowsLiveWriter/DocBookEclipse_9DF8/project_2.gif"><img title="project" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" alt="project" src="http://www.blogjava.net/images/blogjava_net/antony9/WindowsLiveWriter/DocBookEclipse_9DF8/project_thumb.gif" border="0" height="209" width="219" /></a> </div>
</div>
<div class="sect2" title="3.2.&nbsp;第一个Docbook文档">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N100BB"></a>3.2. 第一个Docbook文档</h3>
</div>
</div>
</div>
<p>在&#8220;documents&#8221;文件夹里面，创建一个&#8220;book.xml&#8221;文件，并输入下面的xml文件 </p>
<pre class="programlisting">&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "../docbook-xml-4.5/docbookx.dtd"&gt;
&lt;article&gt;
&lt;articleinfo&gt;
&lt;title&gt;DocBook Intro&lt;/title&gt;
&lt;author&gt;
&lt;firstname&gt;Lars&lt;/firstname&gt;
&lt;surname&gt;Vogel&lt;/surname&gt;
&lt;/author&gt;
&lt;/articleinfo&gt;
&lt;sect1 label="1.0"&gt;
&lt;title&gt;An introduction to DocBook&lt;/title&gt;
&lt;para&gt;
This is text.
&lt;/para&gt;
&lt;/sect1&gt;
&lt;/article&gt;
</pre>
<p>在xml文件中，&#8220;../docbook-xml-4.5/docbook.dtd&#8221;对应于我们刚刚创建的文件夹以及放入的DTD文件。 </p>
</div>
<div class="sect2" title="3.3.&nbsp;使用Ant把Docbook转换为HTML格式">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N100C4"></a>3.3. 使用Ant把Docbook转换为HTML格式</h3>
</div>
</div>
</div>
<p>接下来我们配置ANT。在工程目录中，创建build.xml文件如下： </p>
<pre class="programlisting">&lt;?xml version="1.0"?&gt;
&lt;!--
- Author: Lars Vogel
--&gt;
&lt;project name="docbook-src" default="build-html"&gt;
&lt;description&gt;
This Ant buildhtml.xml file is used to transform DocBook XML to html output
&lt;/description&gt;
&lt;!--
- Configure basic properties that will be used in the file.
--&gt;
&lt;property name="docbook.xsl.dir" value="docbook-xsl" /&gt;
&lt;property name="doc.dir" value="output" /&gt;
&lt;property name="documents" value="documents" /&gt;
&lt;property name="html.stylesheet" value="${docbook.xsl.dir}/html/docbook.xsl" /&gt;
&lt;!-- Making xalan available --&gt;
&lt;path id="xalan.class.path"&gt;
&lt;pathelement location="lib/xalan/serializer.jar" /&gt;
&lt;pathelement location="lib/xalan/xalan.jar" /&gt;
&lt;pathelement location="lib/xalan/xercesImpl.jar" /&gt;
&lt;pathelement location="lib/xalan/xml-apis.jar" /&gt;
&lt;/path&gt;
&lt;!--
- target: usage
--&gt;
&lt;target name="usage" description="Prints the Ant build.xml usage"&gt;
&lt;echo message="Use -projecthelp to get a list of the available targets." /&gt;
&lt;/target&gt;
&lt;!--
- target: clean
--&gt;
&lt;target name="clean" description="Cleans up generated files."&gt;
&lt;delete dir="${doc.dir}" /&gt;
&lt;/target&gt;
&lt;!--
- target: depends
--&gt;
&lt;target name="depends"&gt;
&lt;mkdir dir="${doc.dir}" /&gt;
&lt;/target&gt;
&lt;!--
- target: build-html
- description: Iterates through a directory and transforms
- .xml files into .html files using the DocBook XSL.
--&gt;
&lt;target name="build-html" depends="depends" description="Generates HTML files from DocBook XML"&gt;
&lt;xslt style="${html.stylesheet}" extension=".html" basedir="${documents}" destdir="${doc.dir}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;param name="html.stylesheet" expression="style.css" /&gt;
&lt;classpath refid="xalan.class.path" /&gt;
&lt;/xslt&gt;
&lt;!-- Copy the stylesheet to the same directory as the HTML files --&gt;
&lt;copy todir="${doc.dir}"&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="style.css" /&gt;
&lt;/fileset&gt;
&lt;/copy&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
<p>运行build.xml文件（右键 -&gt; Run As -&gt; Ant Build）。运行之后，在你的output文件夹里面， 应该已经有一个&#8220;book.html&#8221;了。 </p>
<p>恭喜你完成了第一个Docbook文档，并顺利的转成了HTML格式！ </p>
</div>
</div>
<div class="sect1" title="4.&nbsp;Docbook examples">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N100CF"></a>4. Docbook examples</h2>
</div>
</div>
</div>
<p>下面是一些使用Docbook标签的概览。</p>
<div class="sect2" title="4.1.&nbsp;标签">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N100D5"></a>4.1. 标签</h3>
</div>
</div>
</div>
<div class="table"><a name="N100D8"></a>
<p class="title"><strong>Table 1. Docbook一些重要的标签</strong></p>
<div class="table-content">
<table summary="Docbook一些重要的标签" border="1">
     <thead>
         <tr>
             <th align="left">Tag</th>
             <th align="left">说明</th>
         </tr>
     </thead>
     <tbody>
         <tr>
             <td align="left">&lt;![CDATA[ 此处可输入特殊字符,e.g. &amp; ]]&gt;</td>
             <td align="left">在标签中可以输入某些特殊字符，例如某些xml以及Docbook的特殊字符。</td>
         </tr>
         <tr>
             <td align="left">&lt;programlisting&gt; &lt;/programlisting&gt; </td>
             <td align="left">表示该文本是程序代码</td>
         </tr>
         <tr>
             <td align="left">&lt;emphasis&gt; &lt;/emphasis&gt; </td>
             <td align="left">表示用强调（Highlight）该文本</td>
         </tr>
         <tr>
             <td align="left">&lt;xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="example1.txt" /&gt; </td>
             <td align="left">包含example1.xml的内容。该文件可以是一个独立的xml文件</td>
         </tr>
         <tr>
             <td align="left">&lt;ulink url="http://www.heise.de/newsticker"&gt;German IT News&lt;/ulink&gt; <sup>[<a class="footnote" href="#ftn.link" name="link">a</a>]</sup> </td>
             <td align="left">在文档中创建一个超链接</td>
         </tr>
         <tr>
             <td align="left">&amp;amp;</td>
             <td align="left">在文档中插入&#8220;&amp;&#8221;符号</td>
         </tr>
     </tbody>
     <tbody class="footnotes">
         <tr>
             <td colspan="2">
             <div class="footnote">
             <p><sup>[<a class="para" id="ftn.link" href="#link">a</a>] </sup>译者注：Docbook5改变了超链接的格式。关于Docbook5以及更详细的Eclipse配置Docbook教程，会很快放出。 不过，即使是在Docbook5的环境下，使用ulink一样可以顺利的用XSLT转换，只不过Eclipse的xml编辑器会提示有错误。 </p>
             </div>
             </td>
         </tr>
     </tbody>
</table>
</div>
</div>
</div>
<div class="sect2" title="4.2.&nbsp;表格">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N1010D"></a>4.2. 表格</h3>
</div>
</div>
</div>
<p>下面是一个创建表格的例子</p>
<pre class="programlisting">&lt;table frame='all'&gt;
&lt;title&gt;Sample Table&lt;/title&gt;
&lt;tgroup cols='2' align='left' colsep='1' rowsep='1'&gt;
&lt;colspec colname='c1' /&gt;
&lt;colspec colname='c2' /&gt;
&lt;thead&gt;
&lt;row&gt;
&lt;entry&gt;a4&lt;/entry&gt;
&lt;entry&gt;a5&lt;/entry&gt;
&lt;/row&gt;
&lt;/thead&gt;
&lt;tfoot&gt;
&lt;row&gt;
&lt;entry&gt;f4&lt;/entry&gt;
&lt;entry&gt;f5&lt;/entry&gt;
&lt;/row&gt;
&lt;/tfoot&gt;
&lt;tbody&gt;
&lt;row&gt;
&lt;entry&gt;b1&lt;/entry&gt;
&lt;entry&gt;b2&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;d1&lt;/entry&gt;
&lt;entry&gt;d5&lt;/entry&gt;
&lt;/row&gt;
&lt;/tbody&gt;
&lt;/tgroup&gt;
&lt;/table&gt;
</pre>
<p>生成的表格看起来是这样的</p>
<div><a name="N10116"></a>
<p class="title"><strong>Table 2. Sample Table</strong></p>
<div class="table-content">
<table summary="Sample Table" border="1">
     <colgroup>
     <col class="c1" align="left">
     <col class="c2" align="left"></colgroup>
     <thead>
         <tr>
             <th align="left">a4</th>
             <th align="left">a5</th>
         </tr>
     </thead>
     <tfoot>
     <tr>
         <th align="left">f4</th>
         <th align="left">f5</th>
     </tr>
     </tfoot>
     <tbody>
         <tr>
             <td align="left">b1</td>
             <td align="left">b2</td>
         </tr>
         <tr>
             <td align="left">d1</td>
             <td align="left">d5</td>
         </tr>
     </tbody>
</table>
</div>
</div>
</div>
<div class="sect2" title="4.3.&nbsp;列表">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N1013A"></a>4.3. 列表</h3>
</div>
</div>
</div>
<p>没有序号的列表可以这样创建：</p>
<pre class="programlisting">&lt;itemizedlist&gt;
&lt;listitem&gt;
&lt;para&gt;Item1&lt;/para&gt;
&lt;/listitem&gt;
&lt;listitem&gt;
&lt;para&gt;Item2&lt;/para&gt;
&lt;/listitem&gt;
&lt;listitem&gt;
&lt;para&gt;Item3&lt;/para&gt;
&lt;/listitem&gt;
&lt;listitem&gt;
&lt;para&gt;Item4&lt;/para&gt;
&lt;/listitem&gt;
&lt;/itemizedlist&gt;
</pre>
<p>输出结果如下：</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
     <li class="listitem">
     <p>Item1</p>
     </li>
     <li class="listitem">
     <p>Item2</p>
     </li>
     <li class="listitem">
     <p>Item3</p>
     </li>
     <li class="listitem">
     <p>Item4</p>
     </li>
</ul>
</div>
<p>而带编号的列表可以这样写：</p>
<pre class="programlisting">&lt;orderedlist&gt;
&lt;listitem&gt;
&lt;para&gt;This is a list entry&lt;/para&gt;
&lt;/listitem&gt;
&lt;listitem&gt;
&lt;para&gt;This is another list entry&lt;/para&gt;
&lt;/listitem&gt;
&lt;/orderedlist&gt;
</pre>
<p>输出结果如下：</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
     <li class="listitem">
     <p>This is a list entry</p>
     </li>
     <li class="listitem">
     <p>This is another list entry</p>
     </li>
</ol>
</div>
</div>
<div class="sect2" title="4.4.&nbsp;链接">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N1015D"></a>4.4. 链接</h3>
</div>
</div>
</div>
<p>链接可以用下面的方法来创建：<sup>[<a class="footnoteref" href="#ftn.link">a</a>]</sup> </p>
<pre class="programlisting">&lt;para&gt;
We use the Ant integrated into Eclipse. See
&lt;ulink url="http://www.vogella.de/articles/ApacheAnt/article.html"&gt; Apache Ant Tutorial&lt;/ulink&gt;
for an introduction into Apache Ant.
&lt;/para&gt;
</pre>
</div>
<div class="sect2" title="4.5.&nbsp;插入图片">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10167"></a>4.5. 插入图片</h3>
</div>
</div>
</div>
<p>插入图片可以使用下面的方式。</p>
<pre class="programlisting">&lt;para&gt;
&lt;mediaobject&gt;
&lt;imageobject&gt;
&lt;imagedata fileref="images/antview10.gif" format="gif"&gt;
&lt;/imagedata&gt;
&lt;/imageobject&gt;
&lt;/mediaobject&gt;
&lt;/para&gt;
</pre>
</div>
</div>
<div class="sect1" title="5.&nbsp;创建pdf输出">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N1016E"></a>5. 创建pdf输出</h2>
</div>
</div>
</div>
<div class="sect2" title="5.1.&nbsp;安装">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10172"></a>5.1. 安装</h3>
</div>
</div>
</div>
<p>Docbook转成pdf的过程是：先由docbook转成XSL-FO格式，再利用Apache FOP把FO转成 pdf。因此，我们首先需要Apache FOP相关的库。 </p>
<p>XML FO，是XML Formating Object的意思，FO格式是一种处理打印、印刷介质的XML标准。 </p>
<p>可以从<a class="link" href="http://xmlgraphics.apache.org/fop/" target="_top">http://xmlgraphics.apache.org/fop/</a>下载FOP的最新版本。 </p>
<p>从下载的FOP发行版中，把所有的jar文件都拷贝到你的lib文件夹中，并把这些库都加入到ant 的build path中。可以参考 <a class="link" href="http://www.vogella.de/articles/ApacheAnt/article.html#classpath" target="_top">Apach Ant Tutorial</a>来修改ant的build path。 </p>
</div>
<div class="sect2" title="5.2.&nbsp;定义Ant Task">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10184"></a>5.2. 定义Ant Task</h3>
</div>
</div>
</div>
<p>要在ant中使用fop，我们首先应当定义一个fop相关的ant task，然后在后面的脚本中使用这个任务。 下面的这个例子演示了怎样定义一个ant task并怎样调用。第二个例子是一个完整的build.xml文件的例子。 </p>
<pre class="programlisting">&lt;!--
- Defines the ant task for fop
--&gt;
&lt;taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" /&gt;
&lt;!-- Transformation into pdf
- Two steps
- 1.) First create the FO files
- 2.) Then transform the FO files into pdf files
--&gt;
&lt;!--
- target: build-pdf
- description: Iterates through a directory and transforms
- .xml files into .fo files using the DocBook XSL.
--&gt;
&lt;target name="build-pdf" depends="depends, xinclude"
description="Generates HTML files from DocBook XML"&gt;
&lt;!-- Convert DocBook Files into FO --&gt;
&lt;xslt style="${fo.stylesheet}" extension=".fo" basedir="${src.tmp}"
destdir="${src.tmp}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;param name="section.autolabel" expression="1" /&gt;
&lt;/xslt&gt;
&lt;!-- Convert FO Files into pdf --&gt;
&lt;fop format="application/pdf" outdir="${doc.dir}"&gt;
&lt;fileset dir="${src.tmp}"&gt;
&lt;include name="**/*.fo" /&gt;
&lt;/fileset&gt;
&lt;/fop&gt;
&lt;/target&gt;
</pre>
<pre class="programlisting">&lt;?xml version="1.0"?&gt;
&lt;!--
- Author: Lars Vogel
--&gt;
&lt;project name="docbook-src" default="all"&gt;
&lt;description&gt;
This Ant build.xml file is used to transform DocBook XML to
various output formats
&lt;/description&gt;
&lt;!--
- Defines the ant task for xinclude
--&gt;
&lt;taskdef name="xinclude" classname="de.vogella.xinclude.XIncludeTask" /&gt;
&lt;!--
- Defines the ant task for xinclude
--&gt;
&lt;taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" /&gt;
&lt;!--
- Configure basic properties that will be used in the file.
--&gt;
&lt;property name="javahelp.dir" value="${basedir}/../Documentation/output/vogella/javahelp" /&gt;
&lt;property name="src" value="${basedir}/documentation" /&gt;
&lt;property name="output.dir" value="${basedir}/../Documentation/output/vogella/articles" /&gt;
&lt;property name="output.tmp" value="${basedir}/output.tmp" /&gt;
&lt;property name="lib" value="${basedir}/lib/" /&gt;
&lt;property name="docbook.xsl.dir" value="${basedir}/docbook-xsl-1.72.0" /&gt;
&lt;property name="xinclude.lib.dir" value="${basedir}/lib/" /&gt;
&lt;!--
- Usage of the differect style sheets which will be used for the transformation
--&gt;
&lt;property name="eclipse.stylesheet" value="${docbook.xsl.dir}/eclipse/eclipse.xsl" /&gt;
&lt;property name="html.stylesheet" value="${docbook.xsl.dir}/html/docbook.xsl" /&gt;
&lt;property name="fo.stylesheet" value="${docbook.xsl.dir}/fo/docbook.xsl" /&gt;
&lt;property name="javahelp.stylesheet" value="${docbook.xsl.dir}/javahelp/javahelp.xsl" /&gt;
&lt;property name="chunk-html.stylesheet" value="${docbook.xsl.dir}/html/chunk.xsl" /&gt;
&lt;!--
- target: usage
--&gt;
&lt;target name="usage" description="Prints the Ant build.xml usage"&gt;
&lt;echo message="Use -projecthelp to get a list of the available targets." /&gt;
&lt;/target&gt;
&lt;!--
- target: clean
--&gt;
&lt;target name="clean" description="Cleans up generated files."&gt;
&lt;delete dir="${output.dir}" /&gt;
&lt;/target&gt;
&lt;!--
- target: depends
--&gt;
&lt;target name="depends"&gt;
&lt;mkdir dir="${output.dir}" /&gt;
&lt;/target&gt;
&lt;!--
- target: copy
- Copies the images from the subdirectories to the target folder
--&gt;
&lt;target name="copy"&gt;
&lt;echo message="Copy the images" /&gt;
&lt;copy todir="${output.dir}"&gt;
&lt;fileset dir="${src}"&gt;
&lt;include name="**/images/*.*" /&gt;
&lt;/fileset&gt;
&lt;/copy&gt;
&lt;/target&gt;
&lt;!--
- target: xinclude
- description: Creates one combined temporary files for the different inputs files.
- The combined file will then be processed via different ant tasks
--&gt;
&lt;target name="xinclude"&gt;
&lt;xinclude in="${src}/DocBook/article.xml" out="${output.tmp}/DocBook/article.xml" /&gt;
&lt;xinclude in="${src}/JavaConventions/article.xml" out="${output.tmp}/JavaConventions/article.xml" /&gt;
&lt;xinclude in="${src}/JUnit/article.xml" out="${output.tmp}/JUnit/article.xml" /&gt;
&lt;xinclude in="${src}/EclipseReview/article.xml" out="${output.tmp}/EclipseReview/article.xml" /&gt;
&lt;xinclude in="${src}/HTML/article.xml" out="${output.tmp}/HTML/article.xml" /&gt;
&lt;xinclude in="${src}/Eclipse/article.xml" out="${output.tmp}/Eclipse/article.xml" /&gt;
&lt;xinclude in="${src}/Logging/article.xml" out="${output.tmp}/Logging/article.xml" /&gt;
&lt;!--
&lt;xinclude in="${src}/ant/article.xml" out="${src.tmp}/ant/article.xml" /&gt;
--&gt;
&lt;/target&gt;
&lt;!--
- target: build-html
- description: Iterates through a directory and transforms
- .xml files into .html files using the DocBook XSL.
--&gt;
&lt;target name="build-html" depends="depends, xinclude" description="Generates HTML files from DocBook XML"&gt;
&lt;xslt style="${html.stylesheet}" extension=".html" basedir="${output.tmp}" destdir="${output.dir}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;param name="html.stylesheet" expression="styles.css" /&gt;
&lt;param name="section.autolabel" expression="1" /&gt;
&lt;param name="html.cleanup" expression="1" /&gt;
&lt;outputproperty name="indent" value="yes" /&gt;
&lt;/xslt&gt;
&lt;!-- Copy the stylesheet to the same directory as the HTML files --&gt;
&lt;copy todir="${output.dir}"&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="styles.css" /&gt;
&lt;/fileset&gt;
&lt;/copy&gt;
&lt;/target&gt;
&lt;!--
- target: build-javahelp
- description: Iterates through a directory and transforms
- .xml files into .html files using the DocBook XSL.
--&gt;
&lt;target name="build-javahelp" depends="depends, xinclude" description="Generates HTML files from DocBook XML"&gt;
&lt;xslt style="${javahelp.stylesheet}" extension=".html" basedir="${output.tmp}" destdir="${javahelp.dir}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;outputproperty name="indent" value="yes" /&gt;
&lt;/xslt&gt;
&lt;/target&gt;
&lt;!--
- target: chunks-html
- description: Iterates through a directory and transforms
- .xml files into seperate .html files using the DocBook XSL.
--&gt;
&lt;target name="build-chunks" depends="depends, xinclude" description="Generates chunk HTML files from DocBook XML"&gt;
&lt;xslt style="${html.stylesheet}" extension=".html" basedir="${output.tmp}" destdir="${output.dir}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;param name="html.stylesheet" expression="styles.css" /&gt;
&lt;param name="section.autolabel" expression="1" /&gt;
&lt;param name="html.cleanup" expression="1" /&gt;
&lt;param name="chunk.first.selection" expression="1" /&gt;
&lt;/xslt&gt;
&lt;!-- Copy the stylesheet to the same directory as the HTML files --&gt;
&lt;copy todir="${output.dir}"&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="styles.css" /&gt;
&lt;/fileset&gt;
&lt;/copy&gt;
&lt;/target&gt;
&lt;!-- Transformation into pdf
- Two steps
- 1.) First create the FO files
- 2.) Then transform the FO files into pdf files
--&gt;
&lt;!--
- target: build-pdf
- description: Iterates through a directory and transforms
- .xml files into .fo files using the DocBook XSL.
- Relativebase is set to true to enable FOP to find the graphics which are included
- in the images directory
--&gt;
&lt;target name="build-pdf" depends="depends, xinclude" description="Generates HTML files from DocBook XML"&gt;
&lt;!-- Convert DocBook Files into FO --&gt;
&lt;xslt style="${fo.stylesheet}" extension=".fo" basedir="${output.tmp}" destdir="${output.tmp}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;param name="section.autolabel" expression="1" /&gt;
&lt;/xslt&gt;
&lt;!-- Convert FO Files into pdf --&gt;
&lt;fop format="application/pdf" outdir="${output.dir}" relativebase="true"&gt;
&lt;fileset dir="${output.tmp}"&gt;
&lt;include name="**/*.fo" /&gt;
&lt;/fileset&gt;
&lt;/fop&gt;
&lt;/target&gt;
&lt;!--
- target: chunks-html
- description: Iterates through a directory and transforms
- .xml files into seperate .html files using the DocBook XSL.
--&gt;
&lt;target name="build-eclipse" depends="depends, xinclude" description="Generates Eclipse help files from DocBook XML"&gt;
&lt;xslt style="${eclipse.stylesheet}" basedir="${output.tmp}" destdir="${output.dir}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;/xslt&gt;
&lt;/target&gt;
&lt;target name="all" depends="copy, build-html, build-pdf, build-chunks, build-eclipse"&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
</div>
</div>
<div class="sect1" title="7.&nbsp;控制输出格式">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N1018D"></a>7. 控制输出格式</h2>
</div>
</div>
</div>
<p>我们可以通过修改XSLT样式表的参数来影响输出的结果。下面其中一些参数的介绍。</p>
<div class="sect2" title="7.1.&nbsp;HTML参数">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N10192"></a>7.1. HTML参数</h3>
</div>
</div>
</div>
<div class="table"><a name="N10195"></a>
<p class="title"><strong>Table 3. HTML参数</strong></p>
<div class="table-contents">
<table summary="HTML参数" border="1">
     <colgroup>
     <col>
     <col></colgroup>
     <thead>
         <tr>
             <th align="left">参数</th>
             <th align="left">说明</th>
         </tr>
     </thead>
     <tbody>
         <tr>
             <td align="left">name="section.autolabel" expression="1"</td>
             <td align="left">为section自动编号（例如，第一个section是1，其下一集的section是1.1，以此类推）</td>
         </tr>
         <tr>
             <td align="left">name="chapter.autolabel" expression="1"</td>
             <td align="left">为chapter自动编号</td>
         </tr>
         <tr>
             <td align="left">name="html.stylesheet" expression="styles.css"</td>
             <td align="left">定义html使用的样式表</td>
         </tr>
         <tr>
             <td align="left">name="html.cleanup" expression="1"</td>
             <td align="left">清理html使之更具可读性</td>
         </tr>
     </tbody>
</table>
</div>
</div>
</div>
<div class="sect2" title="7.2.&nbsp;为html增加内容">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N101B8"></a>7.2. 为html增加内容</h3>
</div>
</div>
</div>
<p>Docbook允许在转换成html的时候，导入并包含一个外部的html文件。你可以使用这种技术，在生成 html的时候向其中插入javascript代码。 </p>
<p>下面是一个包含html文件的例子。 </p>
<pre class="programlisting"> &lt;?dbhtml-include href="../../myadditonalcontent.html"?&gt;
</pre>
<p><a class="link" href="http://www.sagehill.net/docbookxsl/InsertExtHtml.html#CodeInPage" target="_top">Inserting external HTML code</a> 有更多的描述。 </p>
</div>
</div>
<div class="sect1" title="7.&nbsp;用Eclipse XSL完成XInclude功能">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N101C7"></a>7. 用Eclipse XSL完成XInclude功能</h2>
</div>
</div>
</div>
<div class="sect2" title="7.1.&nbsp;概述">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N101CB"></a>7.1. 概述</h3>
</div>
</div>
</div>
<p>XInclude技术能帮你重新组织你的docbook文件。你可以在书写每一个章节的时候，都使用 一个单独的xml文件，然后用一个总的xml文件把这些章节都组合起来。简单的说，XInclude 能把不同的xml文件组合成为一个大的xml文件。 </p>
<p>例如，假设你要引入一个&#8220;foo.xml&#8221;文件，则可以写成： </p>
<pre class="programlisting"> &lt;xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="foo.xml" /&gt;
</pre>
<p>下面这个例子是要把导入的文件当做文本： <sup>[<a class="footnote" href="#ftn.N101D6" name="N101D6">1</a>]</sup> </p>
&lt;xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="bar.xml" /&gt;
<p>Eclipse XSL project提供一个XInclude的ant task。在此，我很自豪的告诉各位：这个ant task是我提供给XSL project 的:) </p>
</div>
<div class="sect2" title="7.2.&nbsp;Eclipse XSL工具">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N101DD"></a>7.2. Eclipse XSL工具</h3>
</div>
</div>
</div>
<p>Eclipse XSL工具提供了对XSLT的支持，包括XSL的编辑以及debug的支持。虽然我们这里仅仅使用其中的ant task， 但还是得完整的安装整个包。 </p>
<p>安装XSL工具可以通过Eclipse的update manager完成。 <sup>[<a class="footnote" href="#ftn.N101E4" name="N101E4">2</a>]</sup> 你可以通过 <a class="link" href="http://www.vogella.de/articles/Eclipse/article.html#updatemanager" target="_top">Using the Eclipse update manager </a>来获得更多信息。 </p>
<div class="mediaobject"><a href="http://www.blogjava.net/images/blogjava_net/antony9/WindowsLiveWriter/DocBookEclipse_9DF8/installxsl_2.gif"><img title="installxsl" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" alt="installxsl" src="http://www.blogjava.net/images/blogjava_net/antony9/WindowsLiveWriter/DocBookEclipse_9DF8/installxsl_thumb.gif" border="0" height="495" width="584" /></a> </div>
</div>
<div class="sect2" title="7.3.&nbsp;在Ant中使用XInclude">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="N101F0"></a>7.3. 在Ant中使用XInclude</h3>
</div>
</div>
</div>
<p>在你的Eclipse安装路径中找到&#8220;org.eclipse.wst.xsl.core.jar&#8221;并把这个jar包加入到ANT的classpath中。 这样，你应该就可以创建和运行xinclude tast了。下面是一个build.xml文件的例子： </p>
<pre class="programlisting">&lt;?xml version="1.0"?&gt;
&lt;!--
- Author: Lars Vogel
--&gt;
&lt;project name="docbook-src" default="usage"&gt;
&lt;description&gt;
This Ant build.xml file is used to transform DocBook XML to various
output formats
&lt;/description&gt;
&lt;!--
- Configure basic properties that will be used in the file.
--&gt;
&lt;property name="doc.dir" value="${basedir}/output" /&gt;
&lt;property name="src" value="${basedir}/src" /&gt;
&lt;property name="src.tmp" value="${basedir}/src.tmp" /&gt;
&lt;property name="lib" value="${basedir}/lib/" /&gt;
&lt;property name="docbook.xsl.dir" value="${basedir}/docbook-xsl-1.72.0" /&gt;
&lt;property name="html.stylesheet" value="${docbook.xsl.dir}/html/docbook.xsl" /&gt;
&lt;property name="xinclude.lib.dir" value="${basedir}/lib/" /&gt;
&lt;!--
- target: usage
--&gt;
&lt;target name="usage" description="Prints the Ant build.xml usage"&gt;
&lt;echo message="Use -projecthelp to get a list of the available targets." /&gt;
&lt;/target&gt;
&lt;!--
- target: clean
--&gt;
&lt;target name="clean" description="Cleans up generated files."&gt;
&lt;delete dir="${doc.dir}" /&gt;
&lt;/target&gt;
&lt;!--
- target: depends
--&gt;
&lt;target name="depends"&gt;
&lt;mkdir dir="${doc.dir}" /&gt;
&lt;/target&gt;
&lt;!--
- target: xinclude
- description: Creates one combined temporary files for the different inputs files.
- The combined file will then be processed via different ant tasks
--&gt;
&lt;target name="xinclude"&gt;
&lt;xsl.xinclude in="${src}/DocBook/article.xml" out="${src.tmp}/DocBook/article.xml" /&gt;
&lt;/target&gt;
&lt;!--
- target: build-html
- description: Iterates through a directory and transforms
- .xml files into .html files using the DocBook XSL.
--&gt;
&lt;target name="build-html" depends="depends, xinclude" description="Generates HTML files from DocBook XML"&gt;
&lt;xslt style="${html.stylesheet}" extension=".html" basedir="${src.tmp}" destdir="${doc.dir}"&gt;
&lt;include name="**/*book.xml" /&gt;
&lt;include name="**/*article.xml" /&gt;
&lt;param name="html.stylesheet" expression="styles.css" /&gt;
&lt;/xslt&gt;
&lt;!-- Copy the stylesheet to the same directory as the HTML files --&gt;
&lt;copy todir="${doc.dir}"&gt;
&lt;fileset dir="lib"&gt;
&lt;include name="styles.css" /&gt;
&lt;/fileset&gt;
&lt;/copy&gt;
&lt;/target&gt;
&lt;/project&gt;
</pre>
</div>
</div>
<div class="sect1" title="8.&nbsp;相关链接">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="N101F7"></a>8. 相关链接</h2>
</div>
</div>
</div>
<p><a class="link" href="http://www.sagehill.net/docbookxsl/index.html" target="_top">http://www.sagehill.net/docbookxsl/index.html</a> Docbook XSL Online Book </p>
<p><a class="link" href="http://sourceforge.net/projects/docbook/" target="_top">http://sourceforge.net/projects/docbook/</a> Docbook XSLT样式表项目 </p>
<p><a class="link" href="http://docbook.sourceforge.net/release/xsl/current/doc/" target="_top">http://docbook.sourceforge.net/release/xsl/current/doc/</a> XSLT样式表的参数手册 </p>
<p><a class="link" href="http://sourceforge.net/apps/mediawiki/xslthl/index.php?title=Main_Page" target="_top">http://sourceforge.net/apps/mediawiki/xslthl/index.php?title=Main_Page</a> 如何使用XSLT实现语法高亮 </p>
<p><a class="link" href="http://www.docbook.org/tdg/en/html/docbook.html" target="_top">http://www.docbook.org/tdg/en/html/docbook.html</a> Docbook参数手册 </p>
<p><a class="link" href="http://xmlgraphics.apache.org/fop/" target="_top">http://xmlgraphics.apache.org/fop/</a> Apache FOP项目 </p>
</div>
<div class="footnotes"><br />
<hr align="left" width="100" />
<div class="footnote">
<p><sup>[<a class="para" id="ftn.N101D6" href="#N101D6">1</a>] </sup>译者注：这块儿没看明白，哪位高人指点一下？</p>
</div>
<div class="footnote">
<p><sup>[<a class="para" id="ftn.N101E4" href="#N101E4">2</a>] </sup>译者注：XSL工具被包含在WTP（Web Develop Platform）中。 如果你装的Eclipse是J2EE版本，很可能这个工具在你的Eclipse上已经有了。</p>
</div>
</div>
</div><img src ="http://www.blogjava.net/antony9/aggbug/355908.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-08-07 02:00 <a href="http://www.blogjava.net/antony9/archive/2011/08/07/355908.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Python Programming学习笔记7</title><link>http://www.blogjava.net/antony9/archive/2011/06/13/352193.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Mon, 13 Jun 2011 07:40:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/06/13/352193.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/352193.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/06/13/352193.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/352193.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/352193.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Core Python Programming学习笔记7 - if, 循环，迭代器，列表解析，生成器解析&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/06/13/352193.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/352193.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-06-13 15:40 <a href="http://www.blogjava.net/antony9/archive/2011/06/13/352193.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Python Programming 学习笔记6 - Mapping and Set</title><link>http://www.blogjava.net/antony9/archive/2011/06/10/352046.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Fri, 10 Jun 2011 07:23:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/06/10/352046.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/352046.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/06/10/352046.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/352046.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/352046.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Core Python Programming 学习笔记6 - Mapping and Set&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/06/10/352046.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/352046.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-06-10 15:23 <a href="http://www.blogjava.net/antony9/archive/2011/06/10/352046.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Python Programming学习笔记5 - 字符串，列表，元组</title><link>http://www.blogjava.net/antony9/archive/2011/06/09/351969.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Thu, 09 Jun 2011 04:20:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/06/09/351969.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/351969.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/06/09/351969.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/351969.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/351969.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Core Python Programming学习笔记5 - 字符串，列表，元组&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/06/09/351969.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/351969.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-06-09 12:20 <a href="http://www.blogjava.net/antony9/archive/2011/06/09/351969.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Python Programming 学习笔记4 - 数字相关</title><link>http://www.blogjava.net/antony9/archive/2011/06/09/351968.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Thu, 09 Jun 2011 04:17:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/06/09/351968.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/351968.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/06/09/351968.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/351968.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/351968.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Core Python Programming 学习笔记4 - 数字相关&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/06/09/351968.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/351968.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-06-09 12:17 <a href="http://www.blogjava.net/antony9/archive/2011/06/09/351968.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Python Programming 学习笔记（3）</title><link>http://www.blogjava.net/antony9/archive/2011/03/15/346345.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Tue, 15 Mar 2011 14:15:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/03/15/346345.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/346345.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/03/15/346345.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/346345.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/346345.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Core Python Programming 学习笔记（3）&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/03/15/346345.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/346345.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-03-15 22:15 <a href="http://www.blogjava.net/antony9/archive/2011/03/15/346345.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Python Programming 学习笔记（2）</title><link>http://www.blogjava.net/antony9/archive/2011/03/13/346170.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Sun, 13 Mar 2011 14:30:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/03/13/346170.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/346170.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/03/13/346170.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/346170.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/346170.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Core Python Programming 2 学习笔记（2）&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/03/13/346170.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/346170.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-03-13 22:30 <a href="http://www.blogjava.net/antony9/archive/2011/03/13/346170.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Core Python Programming 学习笔记（1）</title><link>http://www.blogjava.net/antony9/archive/2011/03/13/346163.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Sun, 13 Mar 2011 12:50:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/03/13/346163.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/346163.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/03/13/346163.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/346163.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/346163.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Core Python学习笔记（一） ： Python基础&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/03/13/346163.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/346163.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-03-13 20:50 <a href="http://www.blogjava.net/antony9/archive/2011/03/13/346163.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>速成Java与XML（1）：XML初步</title><link>http://www.blogjava.net/antony9/archive/2011/01/09/342621.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Sun, 09 Jan 2011 08:12:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2011/01/09/342621.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/342621.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2011/01/09/342621.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/342621.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/342621.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 速成Java与XML系列文章之一<br>本文介绍XML的基础知识和概念，是用Java进行XML解析的基础。&nbsp;&nbsp;<a href='http://www.blogjava.net/antony9/archive/2011/01/09/342621.html'>阅读全文</a><img src ="http://www.blogjava.net/antony9/aggbug/342621.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2011-01-09 16:12 <a href="http://www.blogjava.net/antony9/archive/2011/01/09/342621.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用Java和Python写了一个获取星座运程的程序</title><link>http://www.blogjava.net/antony9/archive/2009/08/15/291218.html</link><dc:creator>Antony Lee</dc:creator><author>Antony Lee</author><pubDate>Fri, 14 Aug 2009 16:32:00 GMT</pubDate><guid>http://www.blogjava.net/antony9/archive/2009/08/15/291218.html</guid><wfw:comment>http://www.blogjava.net/antony9/comments/291218.html</wfw:comment><comments>http://www.blogjava.net/antony9/archive/2009/08/15/291218.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/antony9/comments/commentRss/291218.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/antony9/services/trackbacks/291218.html</trackback:ping><description><![CDATA[<p>我会争取在近期用Python写个图形界面。之所以现在不写，是因为现在我还不会……</p> <p>原理很简单，就是用程序去获得腾讯星座网站的源码，然后简单解析一下就可以了。原来试图用dom解析，结果发现腾讯和新浪的网站都会解析出错，一狠心干脆直接用字符串的替换。</p> <p>Java那个程序的功能多一些，写了读取“明天”、“本周”、“下周”、“本月”、“下月”的功能，主函数中提供了读取“明天”的功能，默认会在当前工作目录下生成“yuncheng_XXX.txt”文件。实在懒得写客户端了，甚至于命令行客户端都不想写了，因为昨天写这个破东西写到了11点半，原以为很简单的呢，结果郁闷坏了。真是水平大幅度下滑啊。</p> <p>今天晚上用python写了一个程序，这是我用Python写的第一个程序哟~~（如果不算helloworld的话。。。）这个程序功能比较简单，只能获得明日运程。</p> <p>刚刚写出来而已，注释很乱，代码很乱。写这篇博客只是因为母鸡心态：好歹有了个新东西了，怎么也得让我叫唤两声吧。</p> <p>下载地址：</p><a title=" http://www.rayfile.com/files/bc9485dc-88e8-11de-b777-0014221f469f/" href=" http://www.rayfile.com/files/bc9485dc-88e8-11de-b777-0014221f469f/">http://www.rayfile.com/files/bc9485dc-88e8-11de-b777-0014221f469f/<br></a><img src ="http://www.blogjava.net/antony9/aggbug/291218.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/antony9/" target="_blank">Antony Lee</a> 2009-08-15 00:32 <a href="http://www.blogjava.net/antony9/archive/2009/08/15/291218.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>