P
pbd22
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.StringBuilder
sbhtml.Append("<Some XML Tag>")
etc...
Context.Response.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/PresentationTier/set/set_progress.aspx
Line Number 1, Column 191:<?xml version='1.0' encoding='ISO-8859-1'?
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.StringBuilder
sbhtml.Append("<Some XML Tag>")
etc...
Context.Response.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/PresentationTier/set/set_progress.aspx
Line Number 1, Column 191:<?xml version='1.0' encoding='ISO-8859-1'?
bytessent><filesize>12444894</filesize><percent>0</percent></upload></<uploads><upload><filename>SomeVideo.gvi</filename><bytessent>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