我有以下 2 个 xml 案例,我想在其中链接它们,这里我想使用 XSLT 1.0,而不是 2.0 和 RE。在这里,我正在尝试尽可能多地自动化我的脚本,但是我陷入了存在以下任何情况的地方。请让我知道我该如何解决。
情况1:
<para>See Chapter 9. </para>
案例2:
<para>Many parties often come from different localities
and therefore jurisdiction of arbitration can often be
an issue for the arbitration commission to determine in
Chapter 12. Enforcement of an award can also be another
issue of concern.</para>
案例3:
<para>Distribution rights for products or services
disputes are common in China. Many brand holders
authorised other legal entities or individuals to use
their brand names under certain conditions and
restrictions see paras.2.213 and 4.214. The other
legal entities/persons need to abide by the franchise
agreement. Many disputes occur due to the lapse of the
franchise agreement, misconduct of the franchisee in the
execution of the franchise agreement, non-payment of
franchise fee and infringement of the franchise rights.
Arbitration has been used to resolve some of these
disputes. </para>
案例4:
<para>The award must take into account the enforcement
issue of the award(refer to para.3.12). The protection
of properties may need to be addressed during arbitration
and parties may request protection of properties through
the court system.</para>
案例5:
<para>The claimant indicates that on 21 August 1998(as
mentioned in Chapter 16) the claimant signed a franchise
agreement with Beijing Y Company for Y Company to use their
brand name(refer to para 5.12) to open a restaurant in
Shanghai namely Shanghai X Famous Roast Duck Ltd</para>
xslt 应该在下面的模板中。这里我使用 para 模板只是为了应用模板,但是在我的代码中有一些条件,只是为了减少它们,我采用了这种方式。
<xsl:template match="para">
<div class="para">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="text()">
<!-- Match should go here-->
</xsl:template>
预期输出如下。
情况1:
<div class="para">See <a href="CHA_CH_09">Chapter 9</a>. </div>
案例2:
<div class="para">Many parties often come from different localities
and therefore jurisdiction of arbitration can often be
an issue for the arbitration commission to determine in
<a href="CHA_CH_12">Chapter 12</a>. Enforcement of an award can also be another
issue of concern.</div>
案例3:
<div class="para">Distribution rights for products or services
disputes are common in China. Many brand holders
authorised other legal entities or individuals to use
their brand names under certain conditions and
restrictions see paras.<a href="CHA_CH_02/02-213">2.213</a> and<a href="CHA_CH_14/14-214">14.214</a>. The other legal
entities/persons need to abide by the franchise
agreement. Many disputes occur due to the lapse of the
franchise agreement, misconduct of the franchisee in the
execution of the franchise agreement, non-payment of
franchise fee and infringement of the franchise rights.
Arbitration has been used to resolve some of these
disputes.</div>
案例4:
<div class="para">The award must take into account the enforcement
issue of the award(refer to para.<a href="CHA_CH_03/03-012">3.012</a>). The protection
of properties may need to be addressed during arbitration
and parties may request protection of properties through
the court system.</div>
案例5:
<div class="para">The claimant indicates that on 21 August 1998(as
mentioned in <a href"CHA_CH_16">Chapter 16</a>) the claimant signed a franchise
agreement with Beijing Y Company for Y Company to use their
brand name(refer to para <a href="CHA_CH_05/05-112">5.112</a>) to open a restaurant in
Shanghai namely Shanghai X Famous Roast Duck Ltd</div>
谢谢。