On 12.06.2016 06:08, Charles Muller
acmuller(_at_)l(_dot_)u-tokyo(_dot_)ac(_dot_)jp wrote:
I have a document written in TEI P5, for which I'd like to generate an
index of words tagged as <term xml:lang="zh"> occurring anywhere
throughout the <body> of the document, which means that the terms are
occurring inside of <p>, which might be under <div2>, <div3>...<div7>.
I've been struggling with this for a few days with no success, so must
after all ask for some help. I'm presently stuck at this stage:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="TEI/text/body">
<html>
<head/>
<body>
<xsl:for-each select="//term[@xml:lang='zh'] ">
<xsl:sort select="term[@xml:lang='zh']"/>
Inside of the for-each you you would need
<xsl:sort select="."/>
<p><xsl:apply-templates/><xsl:text> </xsl:text></p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Otherwise it looks fine (as far as I can tell without knowing the input
format), you will need to explain what "no success" really means, if you
get an error, no output at all, the wrong sort order.
You might want to show a small snippet of input with any namespaces
declarations included, the output you want and then one you get if you
still have problems.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--