Subject: [xsl] position() > 1 not working From: "Michele R Combs mrrothen@xxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 5 Mar 2021 18:54:53 -0000 |
I want to select all the child <DATA> elements of a <COL> except for the first one. I've tried several different things but I must be missing something stupidly obvious since it isn't working. Input data: <ROW> <COL><DATA></DATA></COL> <COL><DATA>Adult Education Audio and Video Collection</DATA></COL> <COL> <DATA>SULF</DATA> <DATA>Bird</DATA> <DATA>Bird</DATA> <DATA>Hawkins</DATA> <COL> <COL> <DATA></DATA> <DATA>24:F:4</DATA> <DATA>36:G:5-7</DATA> <DATA>234:A:1-5</DATA> <COL> <COL> <DATA>Box 1-22</DATA> <DATA>Adds, 3 boxes</DATA> <DATA>Box 23-45</DATA> <DATA>Oversize items</DATA> <COL> </ROW> In my XSL: <xsl:for-each select="fmp:COL[3]/fmp:DATA[position() > 1]"> <xsl:variable name="parent-position" select="position()" /> <xsl:value-of select="../../fmp:COL[3]/fmp:DATA[$parent-position]"/> <xsl:value-of select="../../fmp:COL[4]/fmp:DATA[$parent-position]"/> <xsl:value-of select="../../fmp:COL[5]/fmp:DATA[$parent-position]"/> </xsl:for-each> Expected output: Bird 24:F:4 Adds, 3 boxes Bird 36:G:5-7 Box 23-45 Hawkins 234:A:1-5 Oversize items Actual output: SULF Box 1-22 Bird 24:F:4 Adds, 3 boxes Bird 36:G:5-7 Box 23-45 Hawkins 234:A:1-5 Oversize items I also tried just getting all the <DATA> elements and then testing the position: <xsl:for-each select="fmp:COL[3]/fmp:DATA"> <xsl:if test="position() > 1" /> But that gave the same results. Just to be sure I wasn't crazy, I added an <xsl:value-of> statement to spit out the value of position() at each point, and I see exactly what I expect there (1, 2, 3, 4). What am I missing? Michele +++++++++ Michele Combs | Lead Archivist Special Collections Research Center Visit our blog! library-blog.syr.edu/scrc/<http://library-blog.syr.edu/scrc/> Syracuse University Libraries 222 Waverly Ave Syracuse, New York 13244 t 315.443-2081 | e mrrothen@xxxxxxx<mailto:mrrothen@xxxxxxx> | w scrc.syr.edu SYRACUSE UNIVERSITY syr.edu
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] [ANN] Oxygen XML Editor versi, Octavian Nadolu octa | Thread | Re: [xsl] position() > 1 not workin, David Carlisle d.p.c |
[xsl] [ANN] Oxygen XML Editor versi, Octavian Nadolu octa | Date | Re: [xsl] position() > 1 not workin, David Carlisle d.p.c |
Month |