Martin Holmes wrote:
I'm attempting (using XSL 1.0 and Saxon 6.5.5) to do drop-caps by
matching the first text element in the first paragraph of the second
div0 in a TEI document. Where the text node is a direct child of the p
tag, this works:
<xsl:template match="div0[2]/p[1]/text()[1]">
However, where another tag intervenes in the tree, this fails:
<div0>
<p>
<title>Blah</title> was published in...
</p>
</div0>
Here, the first text node is the one following the title tag,
Well, unless you strip whitespace generously, the first text
node would be the whitespace just after the <p>.
So what I want to do is select the first text node which is a
descendant (rather than a direct child) of the p tag.
Try
<xsl:template match="(div0[2]/p[1]//text())[1]">
note the additional parenthesis (beware, untested). Be sure to
combine this with proper whitespace stripping.
J.Pietschmann
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--