I have been beating my head against the wall with an XSLT issue for a couple of hours, and I clearly am lost.
I am trying to transform some XML to HTML. The relevant portion of my source XML looks like this:
<div xml:id="sect107" type="section" n="107">
<head>F. Indefinite Pronouns.</head>
<div xml:id="sect107.1" type="subsection" n="1">
And I have an XSL version 2.0 stylesheet that contains this template:
<!-- match first <p> within <div> -->
<xsl:variable name="sectTop" select="ancestor::tei:div[@type='section']/descendant::tei:p=current()"/>
When this template matches the second <p> tag in my XML, I am expecting the variable $sectTop to be false, but it is in fact True. This is contrary to my (limited) understanding of how XPath expressions work. Since the <p> tag in question is the second descendant of its div ancestor, and not the first, the boolean expression should evaluate as False.
Can someone kindly enlighten me as to why I am getting this unexpected result?
I am sure this problem is a result of my ignorance, but for what it is worth, I am using Saxon-PE 188.8.131.52 as my transformer.
Many thanks in advance.