我有这个MODSXSLT选择采取哪些子元素
<modsCollection>
<mods ID="master">
<originInfo>
<dateOther encoding="8601" type="publication">2016</dateOther>
</originInfo>
<originInfo>
<dateOther encoding="8601" type="onlineFirst">2015</dateOther>
</originInfo>
<originInfo>
<dateOther encoding="8601" type="accepted">2014</dateOther>
</originInfo>
<originInfo>
<dateOther encoding="8601" type="submitted">2013</dateOther>
</originInfo>
</mods>
</modsCollection>
我需要将这一元素dateOther为等效DC:日期,但我有不同的类型属性,只需要一dateOther(如果一个刊物存在,我们采取这个日期,否则,如果它不比我们在线第一,如果它不存在,接受等)。
所以在上MODS的情况下,我们将创建
<dc:date>2016</dc:date>
因为属性类型=出版物dateOther存在,如果没有,我们将采取类型= onlineFirst等
日期的顺序其他外观可能不同,只能有一个或多个。
问题开始转变,我无法选择所有originInfo/dateOther元素,所以我可以通过选择
<xsl:template match="//mods:mods[@ID = 'master']/mods:originInfo/mods:dateOther">
<xsl:choose>
<xsl:when test="...">
<dc:date>...</dc:date>
</xsl:when>
...
</xsl:choose>
</xsl:template>
任何帮助解决这将是有益的比较。
请注明是否使用XSLT 1.0或2.0。 –