我有一個正是如此格式的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