xsl-list
[Top] [All Lists]

RE: Problem with msxsl:node-set

2004-03-27 18:34:15
David,

I do have a work and progress, and this has been a rather fun (read as
frustrating) process.  I think I am almost to where I want to be.  You are
right, I didn't get any responses on the main problem I presented, so I have
been trudging through it.  You can grab a copy of my sample xml and xsl at
www.unf.edu/~akrp0001/XSL

Thanks for your interest.



-----Original Message-----
From: M. David Peterson [mailto:m(_dot_)david(_at_)mdptws(_dot_)com] 
Sent: Saturday, March 27, 2004 8:08 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Problem with msxsl:node-set

Normally you would use position() = $begin but it looks like you figured
out a nice shortcut.  By the way...  I haven't forgot about this
mornings email.  I've been tied up in crazy things all day but I am
finally getting a chance to sit down and get this worked out for you.  I
pulled in yesterdays "Difficult Grouping/Matching problem" as well
because the solutions require similar grouping to get the desired output
and it doesn't look like you had any responses.  Im going to plug away
at it each time I have a chance throughout the evening (if you can't
already tell this is going to become one my tutorials for my latest
consulting project as it's a good one to bring in dynamically generated
content coupled with grouping and new element creation all as one
standalone XSL file (I say stand alone meaning no additionally
dependencies on outside functionality beyond that of which is normal
such as accessing external documents and saving transformed files to the
desired location and document format. (which, by the way, knowing you
are sitting on a .NET box this would be an excellent candidate to bring
in a web service to your customer creation and management solution.
Don't worry I'm not making a shameless plug to drum up consulting
business but simply letting you know that this solution will be designed
with web services in mind for whatever the future of your project might
hold.  I think this one will be even more fun that the one I did this
morning... definitely some unique characteristics to this problem.

Best of luck!

<M:D/>

-----Original Message-----
From: Kenny Akridge [mailto:kenny(_at_)akridgefamily(_dot_)com] 
Sent: Saturday, March 27, 2004 5:29 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Problem with msxsl:node-set

I think I just figured it out right after I submitted this.
[number($begin)] seems to be working.

-----Original Message-----
From: Kenny Akridge [mailto:kenny(_at_)akridgefamily(_dot_)com] 
Sent: Saturday, March 27, 2004 7:25 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Problem with msxsl:node-set

I have this variable, whose internal workings aren't very important:

        <xsl:variable name="uniqueClassDates">
                <xsl:for-each
select="ArrayOfAttendance/Attendance/ClassDate[number(substring(.,1,4))
&gt;
0001
                and not(. = preceding::ClassDate)]">
                        <xsl:element name="date">
                                <xsl:value-of select="."/>
                        </xsl:element>
                </xsl:for-each>
        </xsl:variable>

Which holds this value:

<date>2004-01-10T00:00:00.0000000-05:00</date>
<date>2004-01-11T00:00:00.0000000-05:00</date>
<date>2004-01-12T00:00:00.0000000-05:00</date>

The problem occurs while I am running this comparison:

<xsl:if test="msxsl:node-set($uniqueClassDates)/date[$begin] =
ClassDate">

In this case, $begin will be 1, 2 or 3.  However, if I pass ClassDate
with
any value that is contained in $uniqueClassDates, it always returns
true.
How can I limit the logic to only return true when the $begin position
of
date matches ClassDate?

Here is entire template:


<xsl:template name="indexAttendanceCells">
                <xsl:param name="begin"/>
                <xsl:param name="end"/>
                <xsl:choose>
                        <xsl:when test="$begin &gt; $end"></xsl:when>
                        <xsl:otherwise>
                                <xsl:variable name="attended">
                                        <xsl:if
test="msxsl:node-set($uniqueClassDates)/date[$begin] = ClassDate">
        
<xsl:text>true</xsl:text>
                                        </xsl:if>
                                </xsl:variable>
                                <xsl:choose>
                                        <xsl:when test="$attended =
'true'">
                                                <td>
                                                        X
                                                </td>
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <td>
                                                        &#xA0;
                                                </td>
                                                <xsl:call-template
name="indexAttendanceCells">
                                                        <xsl:with-param
name="begin" select="$begin + 1"/>
                                                        <xsl:with-param
name="end" select="$end"/>
                                                </xsl:call-template>
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




<Prev in Thread] Current Thread [Next in Thread>