0
<list list-type="simple" specific-use="front">
<list-item><p>Preface <xref rid="b-9781783084944-FM-001" ref-type="sec">00</xref></p></list-item>
<list-item><p>Series Title <xref rid="b-9781783084944-FM-003" ref-type="sec">00</xref></p></list-item>
<list-item><p>Dedication</p></list-item>
<list-item><p>Acknowledgments <xref rid="b-9781783084944-FM-005" ref-type="sec">00</xref></p></list-item>
<list-item><p>Contributors <xref rid="b-9781783084944-FM-006" ref-type="sec">00</xref></p></list-item>
<list-item><p>Glossary <xref rid="b-9781783084944-FM-008" ref-type="sec">00</xref></p></list-item>
</list>
我需要以下
<div class="pagebreak" id="b-9781783084944-FM-002">
<h2 class="PET"><a href="#tocb-9781783084944-FM-002">CONTENTS</a></h2>
<div class="TocPrelims"><a href="#b-9781783084944-FM-001">Preface</a></div>
<div class="TocPrelims"><a href="#b-9781783084944-FM-002">Series Title</a> </div>
</div>
输出LIK我的XSLT:
<xsl:template match="list[@specific-use='front'][@list-type='simple']/list-item/p">
<div class="TocPrelims">
<a>
<xsl:attribute name="href">
<xsl:text>#toc</xsl:text>
<xsl:copy-of select="//list[@specific-use='front'][@list-type='simple']/list-item/p/xref[@rid]"/>
</xsl:attribute>
<xsl:apply-templates/>
</a>
</div>
</xsl:template>
以上矿井的编码不正确请给点建议。
你能否改善你问题中代码的格式?如果您编辑问题并突出显示代码示例,那么只需单击“{}”按钮对其进行格式化(在每行之前放置4个空格)以使其可读。谢谢! –
@Raja Ananth,如果下面的答案适合你的要求,那么接受tic正确的标记。 –