【发布时间】:2016-09-12 11:21:16
【问题描述】:
在我的 xml 中有三个部分标题,都在 h1 位置,但我希望第一部分作为 h1 位置,remaning 必须是 h2 位置,我的 xml 文件是
<section>
<title>DESCRIPTION</title>
<p>The A380 is available with two types of turbofan engines, the
Rolls-Royce Trent 900 (variants A380-841, −842 and −843F) or the Engine
Alliance GP7000 (A380-861 and −863F). Noise reduction was an important
requirement in the A380 design, and particularly affects engine design.</p>
<p>Landing gears<ul>
<li>
<p>Nose Landing Gear</p>
</li>
<li>
<p>Wing Landing Gear (Bogie Type, 4 Wheels - 4 Braked)</p>
</li>
<li>
<p>Body Landing Gear (Bogie Type, 6 Wheels - 4 Braked)</p>
</li>
</ul>
</p>
</section>
<section>
<title>Wing Landing Gear</title>
<p>Each wing landing gear has a leg assembly and
a four-wheel bogie beam. The WLG leg includes a Bogie Trim Actuator
(BTA) and an oleo-pneumatic shock absorber.</p>
</section>
<section>
<title>Body Landing Gear</title>
<p>The two body landing gears have a six-wheel bogie
beam and a leg assembly that includes an oleo- pneumatic shock absorber.
A two-piece drag-stay assembly mechanically locks the leg in the extended
position.</p>
<fig>
<title>Landing gear</title>
<image align="center" href="../ICN-HSXWB-A-791111-H-F0302-00001-A-001-01.tif"/>
</fig>
</section>
我使用 xslt 作为
<xsl:template match="*[contains(@class,' topic/section ')][@spectitle != ''
and not(*[contains(@class, ' topic/title ')])]"
mode="dita2xslfo:section-heading"
priority="10">
<fo:block xsl:use-attribute-sets="section.title">
<xsl:call-template name="commonattributes"/>
<xsl:variable name="spectitleValue" as="xs:string" select="string(@spectitle)"/>
<xsl:variable name="resolvedVariable">
<xsl:call-template name="insertVariable">
<xsl:with-param name="theVariableID" select="$spectitleValue"/>
</xsl:call-template>
</xsl:variable>
<xsl:sequence
select="if (not(normalize-space($resolvedVariable)))
then $spectitleValue
else $resolvedVariable"
/>
</fo:block>
<xsl:template match="*[contains(@class,' topic/section ')]">
<fo:block xsl:use-attribute-sets="section">
<xsl:call-template name="commonattributes"/>
<xsl:apply-templates select="." mode="dita2xslfo:section-heading"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
请指导我。谢谢
【问题讨论】:
-
我不完全理解您所说的“但我希望第一部分本身的字体比其他部分标题的字体高”以及问题出在哪里。您的代码
contains(@class,' topic/section ')没有意义,您的 xml 中没有 @class 属性,如果有,为什么它应该包含 space 主题/部分 space?跨度> -
contains(@class,' topic/section ')表示@BoopathyChandran 使用 DITA,他正在开发 PDF 插件样式表。 -
绝对是的。你明白了 tmakita。你对此有任何想法
-
DITA 1.8.5 版本