0
移動子表我想裏面添加項目的子表:裏面怎麼項目值
我的源XML:
<body>
<p>blahblah</p>
<ul outputclass="l1">
<li outputclass="lt1">blahblah</li>
<li outputclass="lt1">blahblah</li>
<li outputclass="lt1">blahblah
<ul outputclass="l2">
<li outputclass="lt2">blahblah</li>
<li outputclass="lt2">blahblah<fn><p>blah</p></fn></li>
<li outputclass="lt2">blahblah
<ul outputclass="l3">
<li outputclass="lt3">blahblah<fn><p>blah</p></fn></li>
<li outputclass="lt3">blahblah</li>
<li outputclass="lt3">blahblah</li>
</ul></li>
</ul></li>
<li outputclass="lt1">blahblah</li>
<li outputclass="lt1">blahblah</li>
</ul>
<p>blahblah</p>
</body>
myxslt
<xsl:template match="p">
<para>
<xsl:apply-templates/>
</para>
</xsl:template>
<xsl:template match="fn">
<footnote>
<xsl:apply-templates/>
</footnote>
</xsl:template>
<xsl:template match="ul[@outputclass='l1']">
<itemizedlist type="•">
<xsl:apply-templates/>
</itemizedlist>
</xsl:template>
<xsl:template match="ul[@outputclass='l2']">
<itemizedlist type="•">
<xsl:apply-templates/>
</itemizedlist>
</xsl:template>
<xsl:template match="ul[@outputclass='l3']">
<itemizedlist type="•">
<xsl:apply-templates/>
</itemizedlist>
</xsl:template>
<xsl:template match="li[@outputclass='lt1']">
<item><para>
<xsl:apply-templates/>
</para></item>
</xsl:template>
<xsl:template match="li[@outputclass='lt2']">
<item><para>
<xsl:apply-templates/>
</para></item>
</xsl:template>
<xsl:template match="li[@outputclass='lt3']">
<item><para>
<xsl:apply-templates/>
</para></item>
</xsl:template>
輸出我是在得到第閉幕在子列表後需要的子列表末尾:
<body>
<para>blahblah</para>
<itemizedlist type="•">
<item><para>blahblah</para></item>
<item><para>blahblah</para></item>
<item><para>blahblah
<itemizedlist type="•">
<item><para>blahblah</para></item>
<item><para>blahblah<footnote><p>blah</p></footnote></para></item>
<item><para>blahblah
<itemizedlist type="•">
<item><para>blahblah<footnote><p>blah</p></footnote></para></item>
<item><para>blahblah</para></item>
<item><para>blahblah</para></item>
</itemizedlist></para></item>
</itemizedlist></para></item>
<item><para>blahblah</para></item>
<item><para>blahblah</para></item>
</itemizedlist>
<para>blahblah</para>
</body>
但如下所示需要輸出作爲像子列表應該是對閉合和項目之間閉:
<body>
<para>blahblah</para>
<itemizedlist type="•">
<item><para>blahblah</para></item>
<item><para>blahblah</para></item>
**<item><para>blahblah</para>**
<itemizedlist type="•">
<item><para>blahblah</para></item>
<item><para>blahblah</para></item>
**<item><para>blahblah<footnote><p>blah</p></footnote></para>**
<itemizedlist type="•">
<item><para>blahblah<footnote><p>blah</p></footnote></para></item>
<item><para>blahblah</para></item>
<item><para>blahblah</para></item>
**</itemizedlist></item>**
**</itemizedlist></item>**
<item><para>blahblah</para></item>
<item><para>blahblah</para></item>
</itemizedlist>
<para>blahblah</para>
</body>
是否有可能爲粗體之一。 如果可能請建議我
在此先感謝。
謝謝@馬丁Honnen其工作,但腳註元素內一個列表項文本是在那裏,我需要在裏面,你可以建議我。 – User515
我沒有在您的示例中看到任何'footnote'元素,因此您需要澄清您認爲是「腳註」的元素。 –
我已編輯我的問題,你可以請建議我! – User515