I have the following XML file:
<document>
<article>
<head>headline 1</head>
<text>
<paragraph>foo</paragraph>
<paragraph>bar</paragraph>
</text>
<date>
<day>10</day>
<month>05</month>
<year>2002</year>
</date>
<source>some text</source>
<portal>ABC</portal>
<ID number="1"/>
</article>
<article>
<head>headline 2</head>
<text>
<paragraph>lorem ipsum</paragraph>
</text>
<date>
<day>10</day>
<month>05</month>
<year>2002</year>
</date>
<source>another source</source>
<portal>DEF</portal>
<ID number="2"/>
</article>
</document>
Now I'd like to return all nodes of each article that occur after the head node and before the portal node. Therefore I was looking into XPath 2 node comparison (<< and >> operators).
What I have so far is the following, which returns empty:
<xsl:template match="/">
<xsl:copy-of select="/document/article/head/following-sibling::*[. << ./article/portal]"/>
</xsl:template>
Any ideas how to fix that xpath query?