xsl-list
[Top] [All Lists]

Re: [xsl] Slow XSLT

2008-03-03 15:50:46
Hi Manfred,

Thanks again. I will debug the xslt to understand
exactly what it is doing. Then I will write the
javascript test harness to test the speed and let you
know the outcome.

Cheers

C

--- Manfred Staudinger <manfred(_dot_)staudinger(_at_)gmail(_dot_)com>
wrote:

Hi,

In addition to what Michael already discussed:

On 03/03/2008, Cleyton Jordan
<cleytonjordan(_at_)yahoo(_dot_)co(_dot_)uk> wrote:
Where is this template being called from?

 <xsl:template match="Col">
  <td colspan="{$msrs}">
   <div><xsl:value-of select="@heading"/></div>
  </td>
 </xsl:template>
It's called from the "apply-set" template
      <tr>
              <xsl:apply-templates select="$set"/>
      </tr>
With each recursion, a new $set variable is used,
which gets its
initial value here:
      <xsl:with-param name="set" select="$set/*"/>
The new set of nodes is selected to contain all the
child elements
(note the /*) of the nodes in the current set. On
the very last
recursion $set contains the "Col" elements and those
match the
template in question.
The fact that there are no more child elements is
used to stop the
recursion and get the call closed. If you look at
the point in
"apply-set" where we called it again
      <xsl:call-template name="apply-set">
              <xsl:with-param name="set" select="$set/*"/>
      </xsl:call-template>
and where we return from the "active" call, you see
that "apply-set"
has already done all it should do, so closing it
silently.

Hope this helps,

Manfred


On 03/03/2008, Cleyton Jordan
<cleytonjordan(_at_)yahoo(_dot_)co(_dot_)uk> wrote:
Hi Michael,

 Thanks for your input.

 I will debug the xslt and see if I can undertand
what
 is going on.

 Cheer


 C


 --- Michael Ludwig <mlu(_at_)as-guides(_dot_)com> wrote:

 > Cleyton Jordan schrieb:
 > > Hi Manfread,
 > >
 > > I truly appreciate your help. You are real
star :)
 > >
 > > I have just seen your post and before I try
your
 > > changes I would like to ask you what this
line
 > does
 > > i.e. which template does it call?
 > >
 > > <xsl:apply-templates select="$set"/>
 >
 > It "calls" whatever matches the contents of
$set.
 > What is in
 > $set depends on the context. At the place you
 > extracted this
 > line from, a template by the name "apply-set",
there
 > is an
 > xsl:param named "set". The template "apply-set"
is
 > indeed
 > called (using xsl:call-template), as it is a
named
 > template.
 > Other templates are matching templates - these
go
 > without
 > names. They are applied to nodes (using
 > xsl:apply-templates)
 > based on whether or not they match.
 >
 > > Where is this template being called from?
 > >
 > > <xsl:template match="Col">
 > >   <td colspan="{$msrs}">
 > >    <div><xsl:value-of
select="@heading"/></div>
 > >   </td>
 > > </xsl:template>
 >
 > Incidentally, it is "called", or rather
applied, by
 > the
 > xsl:apply-templates above that has caught your
 > intention.
 > It may not be obvious at first glance, but it
 > happens in
 > recursion. See the following snippet from
Manfred's
 > example.
 >
 > >>            <xsl:when test="$set/*">
 > >>                    <xsl:call-template
name="apply-set">
 > >>                            <xsl:with-param
name="set" select="$set/*"/>
 > >>                    </xsl:call-template>
 > >>            </xsl:when>
 >
 > Michael
 >
 >


--~------------------------------------------------------------------
 > 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>
 > --~--
 >
 >







___________________________________________________________
 NEW Yahoo! Cars - sell your car and browse
thousands of new and used cars online!
http://uk.cars.yahoo.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>
--~--





                
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.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>