来自外部文档的XSLT副本

时间:2018-11-09 21:24:35

标签: xslt xslt-2.0

在XSLT 2.0中,我正在将tei-xml文档转换为HTML。在该转换中,我需要另一个文档中的内容:我想将第二个文档中的一小部分节点复制/转换为HTML输出。

在处理主体tei文档时,我获得ID并将其分配给变量:

<xsl:variable name="licenseid" select="./replace(@corresp,'#','')"/>

然后我转到另一个文档,并使用变量获取节点,并将返回的节点分配给变量:

<xsl:variable name="licenseloc" select="doc(concat($somepath,'includes_sourcedesc.xml'))//tei:list[@type='copyright_type']/tei:item[@xml:id=$licenseid]"/>

我获得的该节点如下所示:

<list type="copyright_type">
  <item xml:id="copyright-cc-by-nc-sa-4.0">
     <desc xml:lang="en">This work is made by available the author under the 
     <ref target="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 
        4.0 International License</ref>.</desc>
  </item>
</list>

我想将其(从desc转换为以下形式:

<span>This work is made by available by the author under the 
     <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 
        4.0 International License</a>.</span>

如果这是在我的“当前” tei文档中,我将通过模板进行处理,但是我不确定如何从另一个“当前”文档中复制和转换嵌套层。

0 个答案:

没有答案
相关问题