0

My XML basically look something like this:

<Staff>
     <Row alphakey="doejohn" building="abc" class="Algebra" />
     <Row alphakey="doejohn" building="abc" class="Geometry" />
     <Row alphakey="personbob" building="abc" class="Calculus" />
     <Row alphakey="personbob" building="abc" class="Precalc" />
...
</Staff>

And my code looks a little like this:

<xsl:for-each select="$Rows">
     <xsl:if test="not(@alphakey = preceding-sibling::Rows[1]/@alphakey)">
         ...

For some reason, the test always comes back as true, no matter what. What I need it to do in this situation is only process the first instance of each teacher, and skip the rest. I have also tried this meathod...

<xsl:for-each select="$Rows">
     <xsl:variable name="akey" select="@alphakey"/>
     <xsl:if test="not(preceding-sibling::Rows[@alphakey=$akey])">
     ...

And the same thing happens. What am I doing wrong?

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Erwan Amoureux
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.