There is something rotten going on here. I had a segment of code that was working perfectly and recently it started acting funny -- and no matter what I do it doesnt want to act at all like it should nor can I figure out what is going on.
The problem...
The code is for an article to XML (for loading into flash) conversion. The code below is a stripped down version. I had a sql server loop ripping through some articles based on date and whatever. As of today I opened the file through the browser to review the contents and bammo an error. It was telling me that the XML data on line 3 at position 800 was not in the correct position. After alot of juglling information around, I got the raw output and checked it -- it had generated the XML (from start to finsih) three times. At first I went and checked to see if any changes had been made and the source control said No. Then checked the SQL, maybe something changed there -- no matter what I did I kept on getting three times or twice. So I removed the sql code and still is doubling it up...
ARG! I am sitting here at work (after hours) looking at this thinking I'd rather be at home eating pizza and reading a good book.
Its very wierd; it worked fine and now it doesnt.I havent changed it. This code below doesnt bomb the browser, but it doesnt generate the style sheet version it used to do.
Has there been any server updates recently that might have affected this?
The problem...
The code is for an article to XML (for loading into flash) conversion. The code below is a stripped down version. I had a sql server loop ripping through some articles based on date and whatever. As of today I opened the file through the browser to review the contents and bammo an error. It was telling me that the XML data on line 3 at position 800 was not in the correct position. After alot of juglling information around, I got the raw output and checked it -- it had generated the XML (from start to finsih) three times. At first I went and checked to see if any changes had been made and the source control said No. Then checked the SQL, maybe something changed there -- no matter what I did I kept on getting three times or twice. So I removed the sql code and still is doubling it up...
ARG! I am sitting here at work (after hours) looking at this thinking I'd rather be at home eating pizza and reading a good book.
Its very wierd; it worked fine and now it doesnt.I havent changed it. This code below doesnt bomb the browser, but it doesnt generate the style sheet version it used to do.
Has there been any server updates recently that might have affected this?
Code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Text;
using System.Configuration;
private void Page_Load(object sender, System.EventArgs e)
{
//Response.OutputStream for output to browser
XmlTextWriter XMLWriter = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
//Create Prolog and encoding tags along with opening the article_list tag
XMLWriter.WriteStartDocument();
XMLWriter.WriteComment("XML Article List");
XMLWriter.WriteStartElement("article_list");
string ArticleUrlLocation;
ArticleUrlLocation= "URL INFO";
XMLWriter.WriteStartElement("article");
XMLWriter.WriteAttributeString("id", "6666");
XMLWriter.WriteAttributeString("title_colour", "6666");
XMLWriter.WriteAttributeString("language", "6666");
XMLWriter.WriteAttributeString("image", "Car.jpg");
XMLWriter.WriteAttributeString("url", ArticleUrlLocation);
XMLWriter.WriteAttributeString("animation", "6666");
XMLWriter.WriteAttributeString("transistion","6666");
XMLWriter.WriteAttributeString("total_time","6666");
XMLWriter.WriteElementString("titletext"," START 12345678901234567890");
XMLWriter.WriteElementString("descriptiontext","1234567890123456789012345678901234567890 END");
XMLWriter.WriteEndElement();
XMLWriter.WriteEndElement();
XMLWriter.WriteEndDocument();
XMLWriter.Close();
}