|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: position() oddity?
Peter Flynn wrote:
> <headers>
> <title>First</title>
> <title>Second</title>
> <title>Third</title>
> <title>Fourth</title>
> <title>Fifth</title>
> </headers>
>
> what would you expect position() in template match "headers/title" to
> return? Currently it returns 2 4 6 8 10 using test.xsl (appended) when
> run through xt and cocoon. It's not quite what I expected (1 2 3 4 5 :-)
...
> <xsl:template match="headers">
> <tr>
> <xsl:apply-templates/>
> </tr>
> </xsl:template>
xsl:apply-templates sets the current node list to all the child nodes of
the current node. You apparently thought that the only children were the
'title' elements.
% saxon foo.xml ascii-treeview.xsl
root
|___processing instruction target='cocoon-process' instruction='type="xslt"'
|___processing instruction target='xml-stylesheet' instruction='href="test.xsl" type="text/xsl"'
|___element 'headers'
|___text '\n '
|___element 'title'
| |___text 'First'
|___text '\n '
|___element 'title'
| |___text 'Second'
|___text '\n '
|___element 'title'
| |___text 'Third'
|___text '\n '
|___element 'title'
| |___text 'Fourth'
|___text '\n '
|___element 'title'
| |___text 'Fifth'
|___text '\n'
- Mike
____________________________________________________________________
Mike J. Brown, software engineer at My XML/XSL resources:
webb.net in Denver, Colorado, USA http://skew.org/xml/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








