Welcome to WebmasterWorld Guest from 54.167.102.69

Forum Moderators: httpwebwitch

Message Too Old, No Replies

XML Buffering

From a VERY old post

     
5:28 pm on Mar 7, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:July 14, 2003
posts:130
votes: 0


Hello all,

In this very old thread [webmasterworld.com...] Xoc mentions in message 4 that he is buffering all the content and then flushing it when the page is complete, but that he may change this in the future. Well its been 4 years and i'd like to know if anyone has managed this!

I have an ASP page that produces XML and returns this to the client along with an XSL file to transform the data into something a that looks a little nicer. My problem comes from the long load times that occur when the database calls get heavy.

I'd like to send out the XML data node after node using Response.Flush. However I think because im using IE (im developing for an Intranet) and its automatic transformation that this isn't going to work. It still waits for ages before anything appears in the client browser.

Any ideas would be appreciated?
(Even if its telling me it can't be done, because im doing this in XML I can't use any other buffering tricks to get progress bars etc...)

6:03 pm on Mar 7, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Jan 23, 2004
posts:338
votes: 0


What you using to parse your XML? DOM, SAX, what else?
9:00 am on Mar 8, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:July 14, 2003
posts:130
votes: 0


Im using the ASP response object to output the XML directly to the browser and sending the location of the XSL file i've created to display the data in a report.

So I think the XML is parsed by Internet Explorer using the the XSL file - does that sound right?

12:16 pm on Mar 8, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Jan 23, 2004
posts:338
votes: 0


I don't think the XSL is causing your ASP page to load slowly. XSL is pretty fast since it is XML itself.

My guess is that you have your Response.Flush in your loop. That is of course a guess since I have not seen your ASP code. I can only assume from your comments that your response.flush method is looping.

Here's a solution: If your XML gets displayed node by node from top to bottom, then you could try SAX (Simple API for XML) to display the XML in your ASP.

12:42 pm on Mar 8, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:July 14, 2003
posts:130
votes: 0


Yeah, its the database queries that are talking along time not the XML. I was hoping to find a way to send the XML node after node to IE which is using an XSL file immediately to format the data. I think the problem is that it won't style it until the XML has been fully sent so I get a long waiting time.

Cheers brucec i'll take a look at SAX!

12:54 pm on Mar 10, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 5, 2002
posts:1318
votes: 0


This is a problem with XML - until the whole file is received, it's not valid, so can't be parsed! The only solution lies in sending it in valid chunks, or waiting for a parser that can repair broken XML on the fly. (Hmm.) Unless anyone else knows of a solution.
3:10 pm on Mar 10, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:July 14, 2003
posts:130
votes: 0


Cheers Hester, thats the conclusion that I came to except that I didn't make the connection that it wasn't valid XML so wouldn't parse it. I thought it was just waiting until it all arrived :)
1:47 am on Apr 8, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 24, 2005
posts:965
votes: 0


Why can't you do the transformation on the server?