我正在使用 XML 编辑器 19.1、Saxon PE 9.7。
对于每个选定div
的 ,我希望在graphic/@url
每个<surface>
if surface/@xml:id
=之后显示一个div/@facs
。
XSL
<xsl:for-each select="descendant-or-self::div3[@type='col']/div4[@n]">
<xsl:variable name="div4tablet" select="@facs"/>
<xsl:choose>
<xsl:when test="translate(.[@n]/$div4tablet, '#', '') = preceding::facsimile/surfaceGrp[@type='tablet']/surface[@n]/@xml:id">
<xsl:value-of select=""/> <!-- DISPLAY graphic/@url that follows facsimile/surfaceGrp/surface -->
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
[....]
</xsl:for-each>
TEI
例子
<facsimile>
<surfaceGrp n="1" type="tablet">
<surface n="1.1" xml:id="ktu1-2_i_1_to_10_img">
<graphic url="../img/KTU-1-2-1-10-recto.jpg"/>
<zone xml:id=""/>
<zone xml:id=""/>
</surface>
<surface n="1.2" xml:id="ktu1-2_i_10_to_30_img">
<graphic url="../img/KTU-1-2-10-30-recto.jpg"/>
<zone xml:id=""/>
</surface>
[...]
</surfaceGrp>
<surfaceGrp n="2">
[...]
</surfaceGrp>
</facsimile>
<text>
[...]
<div3 type="col">
<div4 n="1.2.1-10" xml:id="ktu1-2_i_1_to_10" facs="#ktu1-2_i_1_to_10_img">
[...]
</div4>
<div4 n="1.2.10-30" xml:id="ktu1-2_i_10_to_30" facs="#ktu1-2_i_10_to_30_img">
[...]
</div4>
</div3>
</text>
我试过<xsl:value-of select="preceding::facsimile/surfaceGrp[@type='tablet']/surface[@n, @xml:id]/graphic/@url"/>
了,但它显示了所有graphic/@url
,而不仅仅是下面的一个fascsimile/surfaceGrp/surface
。所以我的问题是:如何只显示surface/graphic/@url
每个div3[@type='col']/div4[@n]
?
在此先感谢您的帮助。