XML will not show in the browser.

I'm using vb.net in an asp.net application built in Visual Studio 2005 on WindowsXP.
I am trying to get an xml file to output to the browser.  My program brings in the xml file from a url, then goes through the code (below) to rebuild the xml.  The reason I run it through this code is so the url in the browser address bar will not show where the file is located.  
After the code rebuilds the file, it sends it out to the browser.  I get the error "The XML page cannot be displayed.  The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document".

When I look at "View Source" (below) it shows the xml exactly like it should be.  But I can't get the file to display in the browser.  I'm close, but I need that last step in getting it to the browser.  Can you see where I'm missing it?
                Response.ContentType = "application/xml"
                TypeOfOutputFile = "Output File coming From URL"
               Const STREAM_SIZE = 1048576 'Approx. 1MB. Old value was 8192 which equals 8K.  8192 does not help file damaged issue.
                ' Create a temporary buffer to read from response and write to PDF stream
                Dim Buffer() As Byte = New Byte(STREAM_SIZE) {}
                ' Read the first chunk
                Dim Count As Long = 0
                Dim i As Long = 0
                Dim iSize As Long = STREAM_SIZE
                Count = strmResponseStream.Read(Buffer, i, Buffer.Length)
                ' Read the PDF file till end of stream is reached.
                While Count > 0 'and i >= buffer.Length 
                    i = i + Count
                    ''Count = strmResponseStream.Read( Buffer, 0, Buffer.Length)
                    If i > iSize - STREAM_SIZE Then
                        iSize = iSize + STREAM_SIZE
                        ReDim Preserve Buffer(iSize)  'increases the buffer size.
                    End If
                    Count = strmResponseStream.Read(Buffer, i, Buffer.Length - i)
                End While
                ReDim Preserve Buffer(i - 1)
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="/models/company%20document%20routing/sigsheet.xsl"?>
	<DocumentType>BUILDING PLANS</DocumentType>
	<DocumentOriginator>Tim Allen</DocumentOriginator>
			<name>Tim Allen</name>
			<timestamp>4/12/2006 11:21:48 AM</timestamp>
			<assigned>4/12/2006 11:11:15 AM</assigned>

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Craig WagnerSoftware ArchitectCommented:
The problem seems to be pointing at a problem with your stylesheet, not the XML itself.

<?xml-stylesheet type="text/xsl" href="/models/company%20document%20routing/sigsheet.xsl"?>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
psmithphilAuthor Commented:
You were right, Craig!   I was going through it on the server in debug mode (as localhost) and it didn't know where the stylesheet was.  When I went to the server using http://server.company.com, it was able to find the stylesheet.  So my code was okay, I just wasn't referencing the server correctly.  Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.