473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help..XML Root Element Missing Exception (Visual C#)

1
I am writing a little application in c# which requires application of XSL transform on a RSS feed from YouTube. Here is the relevant code
Expand|Select|Wrap|Line Numbers
  1. HttpWebRequest myreq = (HttpWebRequest)WebRequest.Create(UrlList[FeedPointer]);
  2.                 HttpWebResponse myrep = (HttpWebResponse)myreq.GetResponse();
  3.                 MemoryStream RSSOut = new MemoryStream(); 
  4.                StreamReader mystream = new StreamReader(myrep.GetResponseStream(), Encoding.UTF8);
  5.  
  6.                 try
  7.                 {
  8.  
  9.                     string outputstring;
  10.                     outputstring = mystream.ReadToEnd();
  11.                     RSSOut.Write(ASCIIEncoding.ASCII.GetBytes(outputstring), 0, outputstring.Length);
  12.                     XPathDocument myXPathDoc = new XPathDocument(RSSOut);
I am getting the "XML Root Element Missing" exception while executing the last line of the code (XPathDocument Declaration).

If I dump the outputstring to the console, I indeed see that the feed is not complete. The top parts of the rss feed are missing. I am wondering WHY ??
Mar 26 '07 #1
1 3010
sicarie
4,677 Expert Mod 4TB
Moving to .NET forum.
Mar 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: CB | last post by:
I am using xerces 2.5.0 and xalan 2.6.0, and am following the xinclude instructions on the xerces faq at http://xml.apache.org/xerces2-j/faq-xinclude.html, and I am having no luck. I imagine I...
1
by: Amadelle | last post by:
Hi all, I am so desparately in need of some guidance! After two days of struggling I still can't connect to the Active Directory server. I have used so many different ways and so many different...
6
by: David B. Bitton | last post by:
I am having a problem deserializing XML when the root node is missing a namespace declaration. My Type has an XmlTypeAttribute with a namespace defined. If I attempt to deserialize the XML, I get...
4
by: Iain A. Mcleod | last post by:
Hi I'm stuck with the following schema validation problem in VS.NET 2003: I have two types of xml document and related schema: project and projectCollection. A projectcollection is just a set...
5
by: Paul Nations | last post by:
I'm in a real pickle. I've inherited a project with major problems. It receives encrypted XML files from a website not under my control (so I can't modify the web app) for insertion into a...
2
by: cordata5 | last post by:
Hi I'm using the example posted on Ron Howard's site for encryting the body of an xml file located at http://www.gotdotnet.com/team/rhoward/ I'm running into trouble where i'm getting an error of...
1
by: Ollie Riches | last post by:
I am having trouble with WSE3 and domain authentication\authorisation for a web service. When using a the 'NETWORK SERVICE' account for the application pool in IIS 6.0 the web service work...
1
by: Tomas | last post by:
When I try to load my xslt i get an xml exception with the message "Root element is missing". The stylesheet works when I preview it in stylus studio, but apparently not in my application. Any...
3
by: Simon Brooke | last post by:
As various people will have noticed, I've been having a lot of trouble with XSL lately. Brief history: I wrote myself an XML toolkit back in 2000, and it worked well enough for me, so it's been...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.