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?

eliminating double in XPat 1.0 use this syntax

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

but it's not a good choice with XSLT (very hard cost).
You must use muench method as i say here :
http://www.daniweb.com/forums/thread342766.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.