Hi.
I have an event handler in VB.NET that gets called several times.
The output of the event handler is XML that is being called by
an xmlhttp request from the client.
I am using a stringbuilder to create an XML document every time
the event handler gets fired. Each tag is appended like so:
Dim sbhtml As New System.Text.Str ingBuilder
sbhtml.Append(" <Some XML Tag>")
etc...
Context.Respons e.ContentType = "text/xml"
Response.Write( sbhtml.ToString )
The problem is that the XML document gets recreated and appended every
time the event handler fires and I get a junk error after the first
document's parent tag is closed:
XML Parsing Error: junk after document element
Location: http://localhost:5223/PresentationTi..._progress.aspx
Line Number 1, Column 191:<?xml version='1.0' encoding='ISO-8859-1'?
bytessent><file size>12444894</filesize><perce nt>0</percent></upload></
uploads><?xml version='1.0' encoding='ISO-8859-1'?...
SO: How do I prevent this? How Do I "UPDATE" the XML document every
time the event handler fires and not "APPPEND" a new document to the
recently created one?
Thanks.
Peter
I have an event handler in VB.NET that gets called several times.
The output of the event handler is XML that is being called by
an xmlhttp request from the client.
I am using a stringbuilder to create an XML document every time
the event handler gets fired. Each tag is appended like so:
Dim sbhtml As New System.Text.Str ingBuilder
sbhtml.Append(" <Some XML Tag>")
etc...
Context.Respons e.ContentType = "text/xml"
Response.Write( sbhtml.ToString )
The problem is that the XML document gets recreated and appended every
time the event handler fires and I get a junk error after the first
document's parent tag is closed:
XML Parsing Error: junk after document element
Location: http://localhost:5223/PresentationTi..._progress.aspx
Line Number 1, Column 191:<?xml version='1.0' encoding='ISO-8859-1'?
><uploads><uplo ad><filename>So meVideo.gvi</filename><bytes sent>0</
uploads><?xml version='1.0' encoding='ISO-8859-1'?...
SO: How do I prevent this? How Do I "UPDATE" the XML document every
time the event handler fires and not "APPPEND" a new document to the
recently created one?
Thanks.
Peter
Comment