🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.xml
Article #234

ʹ�� FOP������DocBook xmlת����pdf��ʵ�ּ�¼��ת��)��

#234
From: <Test/>
Date: Wed, 26 May 2010 14:54
105 lines
8323 bytes
http://blog.donews.com/limodou/archive/2004/04/01/9917.aspx
���ĵ�ȷ��һ����ͷʹ�����⡣��˳��XML д�ɵ�DocBook�ĵ�ת����HTML֮��
�����ٵ���һ����ս������ν���ת��ΪPDF�������Ӣ�ĵ��ĵ���һ�ж���OK����
xsl��Ϊ fop/docbook.xsl��Ȼ��ִ��fop -fo your.fo -pdf your.pdf��
�ɣ�����ת�������ϣ�ȴ������ô�򵥡�
����weck���ѹ���ת�������⾭����һϵͳ�ij��ԡ���ҿ��Կ������������ۣ�
reStructuredText �о�
��ʵ����FOP֧���������廹�����ף����ת�����Բο�weckд�ķ�����
�� FOP��DocBook���ΪPDF�ĵ�
����ת�����pdf�ĵ������Ķ��������⣬��Щ�л�û�н����������һ����ȥ
�ˡ����Ϊ�˽�����Ķ��ֵ������Ҳ��˺ö�ط����޹��򷵡�weckҲת��ʹ��
DocBook in ConText��ת��DocBook �ĵ��ˣ�����DocBook in ConText��
ֱ�Ӵ���XML�ĵ���������ɵ�xsl-fo�ĵ�������Ч�����׼��DocBook����
�󣻶��һ�Ҫ�õ�Tex����Ҳ��һ����С�Ĺ��̡���
�����ڸп�֮�࣬��д��һƪ���������ģ���������ʾ�ҵĸ�̾��������λ
SummerRain
���Ѹ������˸��ԣ���������ν�����Ķ��ֵķ��������ǽ�fo�ļ��е�language��
��Ϊzh���ɡ��dz���л���ھ����ҵ���һ������֮�����Ķ��־����ǽ���ˡ�����
���ҵ�ʵ���¼���£�
1. ��δ�ԭʼ��xml���xsl-fo��ʹ��language=��zh����Ч��
SummerRain���ѵķ�������xsl-fo�ļ��м���language=��zh���������xsl-fo��
�������ҵ�Դʼ�ĵ������Ǵ�ԭʼ��xml����ת������ɵģ����ֱ���޸�xsl-fo��
�������ʺϡ�����ҿ�����д�ġ�DocBook ѧϰ���̳̣����潲�������֧������
�ķ�������ʹ�õķ��������Ҽ򵥵�����һ�£�
ʹ��utf-8���룬�ļ�ҲҪ��utf-8���뱣��
ʹ��<xsl:param name=��l10n.gentext.language�� select=����zh_cn����/>��
������
zh_cn��docbook-xsl�ж���õ�������ص���Ϣ�ļ�������Խ�docbook-xslת
��xml����ɵ�һЩ��׼���������ģ��� ��Table of Contents���ͱ�ɡ�Ŀ
¼���ˡ���ô��ת��xsl-fo�ļ�ʱҲʹ����һ����һ����Ҳ���������ã���һ��
�棬�����ɵ�xsl-fo�ļ��󣬻ῴ��language=��zh_cn����Ҳ����˵��xsl-fo
���Ѿ�������language=��zh_cn�ˡ���������zh����ô�����ǣ�������Ȼ����
�⡣���һ����λ�أ�û�취����ֻ�ý�docbook-xsl�е�common/zh_cn.xml�ļ�
������common/zh.xml��Ȼ���� common/l10n.xml�м�����zh.xml��entity��
���������á���Ҫ��common/zh.xml�ļ���ʼ���� language=��zh_cn����Ϊ
language=��zh�����������ǰ������select=��zh_cn����Ϊselect=��zh������
�ˡ������xsl-fo�ļ����򿪺�ῴ��language��ֵΪ��zh���ˡ�
����������������
2. ��������
���ǻ���һЩ����û�н����Ҳ���к����˻�����ҡ����������棺
��Щ���ı���Dz����ھ��׵ģ���FOP�ɲ�����һ�ף������α������ų����ھ�
�ף�
Bookmark�ж����Ժ�ı��⿴���������ĵ������еı��ⶼ��
û��б��
���ʹ������Type1����
��Щ��ʽ��������������bulletǰ��ĵ����ʽ�������pdf����Բ�㡣
3. Ҫע������
���Ŀ�Ȳ��������HTMLһ����ΪHTML���Զ�������Ŀ�ȣ���FOP���У���
�Ǻܾ�ȷ�ģ����ֻ�ܶ��ԣ���ȵı���һ��Ҫ���ʡ�
�����ԭ������Ļ���һ��̫�������Զ����У���������ֽ�ŵı�Ե����˶������
���嵥��������֮���ԭ���������Ҫ���뻻�С�
���渽�������õ�ת������ʽ�����ݣ���ҿ������в��ԣ�
<?xml version=��1.0��?>
<xsl:stylesheet 
xmlns:xsl=��http://www.w3.org/1999/XSL/Transform��
version=��1.0��>
<xsl:import href=��../docbook-xsl/fo/docbook.xsl��/>
<xsl:param name=��body.font.family��>simsun</xsl:param>
<xsl:param name=��monospace.font.family��>simsun</xsl:param>
<xsl:param name=��title.font.family��>simhei</xsl:param>
<xsl:param name=��saxon.character.representation�� 
select=����native����/>
<xsl:param name=��admon.graphics�� select=��1��/>
<xsl:param name=��section.autolabel�� select=��1��/>
<xsl:param name=��section.label.includes.component.label�� 
select=��1��/>
<xsl:param name=��table.borders.with.css�� select=��1��/>
<xsl:param name=��use.extensions�� select=��1��/>
<xsl:param name=��tablecolumns.extension�� select=��0��/>
<xsl:param name=��callout.unicode�� select=��1��/>
<xsl:param name=��callout.unicode.start.character�� 
select=��10102��></xsl:param>
<xsl:param name=��variablelist.as.blocks�� select=��1��></xsl:param>
<xsl:param name=��callout.graphics�� select=��0��/>
<xsl:param name=��fop.extensions�� select=��1��/>
<xsl:param name=��hyphenate��>false</xsl:param>
<xsl:param name=��l10n.gentext.default.language�� select=����zh����/>
<xsl:param name=��paper.type�� select=����A4�䡱/>
<xsl:param name=��draft.mode�� select=����no����/>
<xsl:param name=��generate.toc��>
appendix toc
article/appendix nop
article toc,title
book toc,title
chapter nop
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 nop
sect2 nop
sect3 nop
sect4 nop
sect5 nop
section nop
set toc,title
</xsl:param>
</xsl:stylesheet>
--
Happy XMLing


�� �޸�:��thinkhy �� May 26 22:54:47 2010 �޸ı��ġ�[FROM: 114.249.215.*]
�� ��Դ:��ˮľ���� http://newsmth.net��[FROM: 114.249.215.*]
Technical Details
Message-ID: <507dc6$BHO@newsmth.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!feeds.phibee-telecom.net!news.byr.edu.cn!news.newsmth.net!NEWSMTH

Show Full Headers
Complete Article Headers
X-Google-Thread: 115571,7e319b6ef915e2d8,start
X-Google-NewGroupId: yes
X-Google-Attributes: gidf7ebf7e2af,domainid0,public,usenet
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!feeds.phibee-telecom.net!news.byr.edu.cn!news.newsmth.net!NEWSMTH
From: thinkhy@newsmth.net-SPAM.no (<Test/>)
Newsgroups: cn.bbs.comp.xml
Subject: ʹ�� FOP������DocBook xmlת����pdf��ʵ�ּ�¼��ת��)��
Date: 26 May 2010 14:54:47 GMT
Organization: ˮľ����
Message-ID: <507dc6$BHO@newsmth.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: XML/J/M.1274885670.30