Timeout on Xsl Transformation

G

George Durzi

Bear with me on this one because the explanation might be a bit lengthy. I
have a stored procedure which is returning three tables (using three
SELECTs).

Table 0 is a list of all bills for a job (relates to Table 1 by GB_JOB_ID)
Table 1 is a list of all jobs (relates to Table 2 by ACCOUNT_MANAGER_ID)
Table 2 is a list of all sales people

Not all jobs have bills associated with them. (I think this is where my
problem is, but read on). The stored procedure runs in about 3 seconds, so
it's not a real source of delay.

However, when I try to transform a DataSet (populated from the stored
procedure) using XSL, I get a timeout. That's strange because the stored
procedure executes very fast. So I figured out that the delay was in the
XSL, and I also figured out what was causing the timeout, but I don't know
how to fix it.

Here's a simplified version of the XSL. I took out some of the unnecessary
stuff, so the HTML might be a bit off.

<xsl:for-each select="NewDataSet/Table2">
<tr class="bodytext">
<td align="left" valign="top" colspan="10" bgcolor="bisque">
<b><xsl:value-of select="SALES_CODE" /> - <xsl:value-of
select="USER_NAME" /></b>
</td>
</tr>
<tr>
<td bgcolor="#DADADA">Job Number</td>
</tr>
<xsl:for-each select="../Table1[ACCOUNT_MANAGER_ID/text() =
current()/ACCOUNT_MANAGER_ID/text()]">
<tr class="bodytext" bgcolor="#CCFFFF">
<td valign="top" class="numformat">
<xsl:value-of select="JOB_NUMBER"></xsl:value-of>
</td>
</tr>
<xsl:for-each select="../Table[GB_JOB_ID/text() =
current()/GB_JOB_ID/text()]">
<tr class="bodytext">
<td valign="top">
<xsl:value-of select="BILL_TYPE"></xsl:value-of>
</td>
<td valign="top">
<xsl:value-of select="DATE_CREATED"></xsl:value-of>
</td>
</tr>
</xsl:for-each>

</xsl:for-each>
</xsl:for-each>

If I take out the <xsl:for-each select="../Table[GB_JOB_ID/text() =
current()/GB_JOB_ID/text()]"> for each, the tranformation happens fast.

Remember I said that not all the jobs in Table 1 have bills in Table 0?
Could this be what's causing the above foreach to timeout?

Thanks for reading this far!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top