我有一个正是如此格式的XML块:应用XSLT记号化功能的应用模板结果
<line n="2">
<orig>of right hool herte <ex>&</ex> in our<ex>e</ex><note place="bottom" anchored="true" xml:id="explanatory">Although “r” on the painted panels of the chapel is consistently written with an otiose mark when it concludes a word, the mark here is rendered more heavily and with a dot indicating suspension above the r. This rendering as “our<ex>e</ex>” is a linguistic outlier for the area based on the electronic <emph rend="italic">Linguistic Atlas of Late Medieval English</emph>’s linguistic profiles for “oure,” “our,” and “our<ex>e</ex>.” See eLALME's <ref target="http://archive.ling.ed.ac.uk/ihd/elalme_scripts/mapping/user-defined_maps.html">User Defined Maps</ref> for more information. Unfortunately the current online version (as of 12 July 2014) does not allow direct linking between static dotmaps and linguistic profiles.</note> best entent</orig>
</line>
我需要能够减少它只是明文:“右HOOL herte &的以最佳范围“,然后在空间上标记以获得逗号或标签分隔值的列表。我有明文通过下面的XSLT完成了位:
<xsl:template match="tei:line" >
<xsl:apply-templates />
</xsl:template>
<xsl:template match="orig">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="ex">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="note"/>
但是,我不能得到令牌化功能与应用模板的工作。如果我尝试使用value-of,那么标签下面的标签将不再正常工作。有什么办法可以在xml上运行apply-templates,然后在单个xslt中标记每个元素?谢谢!
我没有看到你在代码示例中的任何地方调用'tokenize'。 – PhillyNJ 2015-02-09 22:02:26
这个练习的预期结果是什么? - 注意:您的前三个模板似乎是多余的,因为内置的模板规则可以做到这一点。 – 2015-02-09 22:16:43
我不会调用标记大小,因为它根本不适用于应用程序模板。如果我使用value-of来调用它,例如select =“tokenize(。,'')”,那么抑制音符不再起作用,或者它将标记为“oure”中已包装在标记中的e 。 – medievalmatt 2015-02-10 23:20:03