I have found this site which says that I can pick a specific node of this code
<xsl:variable name="in-xml" as="item()*"> <in-xml>
<a>1</a>
<c>2</c>
<a>3</a>
<a>4</a>
<a>5</a> </in-xml> </xsl:variable>
It says that if you wrote this:
$in-xml/*[position() > 2]
you would get this:
<a>3</a>
<a>4</a>
<a>5</a>
but it seems not to be working for me.
Here is the site: http://www.xsltfunctions.com/xsl/fn_position.html
Can anyone give the code to get that???
In XSLT 1.0, XPath expressions can only be performed on input data, not on data created in the course of evaluating the stylesheet. So one way to make your example work would be to move the
in-xmldata to an external document and load it using thedocument()function. There are also some tricky / clever techniques that involve writing thein-xmlelement as a child ofxsl:stylesheetand usingdocument('')/xsl:stylesheet/in-xmlto declare the variable; these techniques work with good XSLT 1.0 implementations but fail in some browser implementations.In XSLT 2.0, the constraint on the use of XPath was relaxed and something along the lines you sketch should work.