Subject: Re: [xsl] Slow XSLT From: Cleyton Jordan <cleytonjordan@xxxxxxxxxxx> Date: Sat, 15 Mar 2008 00:54:57 +0000 (GMT) |
Hi Manfred, --- Manfred Staudinger <manfred.staudinger@xxxxxxxxx> wrote: > On 14/03/2008, Cleyton Jordan > <cleytonjordan@xxxxxxxxxxx> > > Because I use Javascript to align my GRID, I have > to > > apply templates in a certain order i.e: > > > > 1- build the bottom right section first (grdBody) > > 2- next build the top right section (column > headings) > > 3- Build the bottom left section (row headings) > > 4- Finaly build the top left section which is > just an > > empty div with the right hight and width to align > with > > the rest of the grid. > I can't see this. You start a xsl-transformation an > you get the > resulting html which contains all 4 sections. To > access them with > javascript, you use an id which the xslt has added. If you use the XSLT I posted to you in my previous message to transform the XML, when you view the result, you will think that both the grid is not aligned and that it did not build correctly. However, the grid is ok but for it to look good after the xslt transformation, I have to use javascript to align all the tables and fix the width of the columns. It is a complex process that uses javascript and the order of the xslt process has to respect the steps I mentioned above. However, if I can build the table like you suggested in your last post then I believe everything will be much easier as well as in javascript. I think I can tranform a table into a grid in javascript so that you can freeze the Row headings and Col headings like in excel for ease of reading when scrolling. But for that to work I need to be able to add the RowGrp levels to the table as I explained in my last post. Have you seen it? > > Please note that I used to be able to control all > > these sections using the MODE ATTRIBUTE > > > > <xsl:apply-templates select="Rows//Row" > > mode="heading"> > > > > However, with apply-templates I might not have > this > > control. What do you think? > Just use > <xsl:apply-templates mode="heading"> > I think your difficulty stems from a misconception: > the select > attribute has its XPath expression evaluated to > construct a set of > nodes (in XSLT 1.0) and apply-templates pushes this > set to the > "template- machine". If there is _no_ select > attribute in > apply-templates then the current node gets pushed to > it. You are right. I am a bit confused about using only apply-templates. All the XSLTs I have coded up to now only use apply-templates select="" and sometimes Modes. But I am planning to read more about all the patters you and the other members of the forum showed me so that I can improve my XSLT coding. > How difficult do you think it would be to change > my > > approach of using 4 DIVs and 4 Tables to build the > > grid and instead creating just one table? > You would have to mimic with xslt what is already > built in into html > tables and you will run certainly into more > performance problems. This is not right. I have now tested your last XSLT against a huge sample xml I have and the results were very good and quite fast. The only problem is that we are missing the RowGrp headings. But if this can be fixed then I think we can create a nice Grid. > I would like to invite you to an off-list > conversation to clarify the > html/javascript concept with you. With such a > concept in hands it > would be much easier to clarify the xslt issues. > > Regards, > > Manfred It would be great to have an off-list conversation with you to clarify any html/javascript concepts you have. As I said before, if we can fix your latest XSLT to produce the RowGrp headings as well then I am sure it will be easier to produce the grid using javascript. By the way, do you know what I mean when I talk about the difference between a table and a grid in html/javascript? With a table when you scroll the page you will not be able to see the columns or row headings. With a grid you freeze the column and row headings and then when you scroll the page you still can compare the data against the colums or rows (depending if you scroll vertically or horizontally) I am looking forward to your reply. Cheers C ___________________________________________________________ Rise to the challenge for Sport Relief with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Slow XSLT, Manfred Staudinger | Thread | Re: [xsl] Slow XSLT, Cleyton Jordan |
Re: [xsl] Slow XSLT, Cleyton Jordan | Date | Re: [xsl] Slow XSLT, Manfred Staudinger |
Month |