我是xsl的新手。
这是样式表模板。
<xsl:template match="LI|li">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:choose>
<xsl:when test="name(..)!='OL'">
<xsl:number format="1."/>
</xsl:when>
<xsl:when test="name(../..)!='OL'">
<xsl:number format="(a)"/>
</xsl:when>
<xsl:when test="name(../../..)!='OL'">
<xsl:number format="(1)"/>
</xsl:when>
<xsl:when test="name(../../../..)!='OL'">
<xsl:number format="(i)"/>
</xsl:when>
<xsl:when test="name(../../../../..)!='OL'">
<xsl:number format="(A)"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>·</xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
此样式表通过上述模板将<li>
(点)转换为数字。
<xsl:template match="SectionsArticlesToPrintVOExRow" mode="terms">
<xsl:choose>
<xsl:when test="AmendOperationCode='DELETED'">
</xsl:when>
<xsl:otherwise>
<fo:block padding-top="12pt" font-size="{$HeaderFontSize}" font-family="Times" id="S{UniqueId}" font-weight="bold">
<xsl:if test="Label and (Label!='')">
<xsl:value-of select="Label"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:value-of select="Title"/>
</fo:block>
<fo:block/>
<xsl:if test="ObjectType='ARTICLE'">
<fo:block font-size="9pt" padding-top="5pt" padding-bottom="5pt" font-family="Times" white-space-collapse="false" linefeed-treatment="preserve" text-align="justify">
<xsl:choose>
<xsl:when test="InsertByReference='Y'">
<xsl:apply-templates select="ReferenceText"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="ArticleText"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
ArticleText:将有条款。
输入:
<SectionsArticlesToPrintVORow>
<UniqueId>ARTICLE33112</UniqueId>
<StructureLevel>2</StructureLevel>
<ObjectType>ARTICLE</ObjectType>
<ParentId>12324</ParentId>
<DocumentId>112943</DocumentId>
<DocumentType>B</DocumentType>
<DisplaySequence>20</DisplaySequence>
<Label> 1.1 </Label>
<Title>Price Increases</Title>
<ArticleNumber>JF0111</ArticleNumber>
<ArticleText>
Only supplies will be used with the Product. All consumable
supplies included in the Master FSM will be provided by Servicing
Providers without additional freight charges to the Customer.
Consumable supplies not covered under this Master FSM are:
<li> <li><u>MFDs</u> - paper and staples, unless otherwise indicated herein. </li> </ul> <li> <li><u>Stand-Alone Facsimiles</u> Process kit, toner, drum, ink film and developer kit are excluded.
</li></ul> <blockquote> Excluded supplies may be purchased from other vendors or Servicing Providers. If another vendor's brand supplies are used, with the exception of paper, maintenance will be voided and customer will waive certain rights under manufacturer's warranty. Servicing Providers will bill separately for excluded supplies not covered. Staples and facsimile supplies may be purchased separately from issuance of a PO. </blockquote> 2.4.<li> <li> <u>Expedited Delivery</u>. Customer may request expedited delivery for consumables. Toshiba will make its best effort to provide consumable rushorders within twenty-four (24) hours. Expedited delivery charges shall apply and rates depend on the method ofdelivery and will be quoted at the time of request. Expedited delivery charges shall be billed separately and directly by the Dealer. </li> </ul> </ArticleText>
<ArticleVersionId>3801</ArticleVersionId>
<ArticleId>3557</ArticleId>
<CatId>33112</CatId>
<InsertByReference>N</InsertByReference>
</SectionsArticlesToPrintVORow>
输出是:
2.4. Consumables
本产品仅使用东芝品牌耗材。主FSM中包含的所有消耗品都将 由东芝服务提供商提供,无需向客户收取额外运费。消耗品 这个主FSM不包括:
1. MFDs - paper and staples, unless otherwise indicated herein.
2. Stand-Alone Facsimiles Process kit, toner, drum, ink film and developer kit are excluded.
可以从其他供应商或服务提供商处购买排除的耗材。如果是其他供应商的非东芝 使用品牌耗材,除纸张外,东芝的维修将无效,客户将放弃 东芝制造商保修条款下的某些权利。服务提供商将单独为不包括的供应品收费 不包括。订书钉和传真用品可以通过发行PO单独从东芝购买。
但是想要的输出:
2.4. Consumables
本产品仅使用东芝品牌耗材。主FSM中包含的所有消耗品都将 由东芝服务提供商提供,无需向客户收取额外运费。消耗品 这个主FSM不包括:
2.4.1. MFDs - paper and staples, unless otherwise indicated herein.
2.4.2. Stand-Alone Facsimiles Process kit, toner, drum, ink film and developer kit are excluded.
可以从其他供应商或服务提供商处购买排除的耗材。如果是其他供应商的非东芝 使用品牌耗材,除纸张外,东芝的维修将无效,客户将放弃 东芝制造商保修条款下的某些权利。服务提供商将单独为不包括的供应品收费 不包括。订书钉和传真用品可以通过发行PO单独从东芝购买。
如何实现所需的输出。
更新
答案 0 :(得分:0)
在xsl:number上使用level =“multiple”选项,例如
<xsl:number level="multiple" format="1.1.1"/>