Re: Illegal Charaters in path

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In the sample code I used the LoadXml first and got Data at the root
level is invalid. Line 1, position 1. Then I tried load, well I
shouldn't since it is for the loading of xml file :) But I still have
the root level in valid message.
So please read doc.Load as doc.LoadXml(b)

Thanks.

DBC User wrote:
Hi Jon,

As I explained before. I have a simple XML
(http://tamil.taisukina.com/ServerReferenceTest.xml) which has only
one. I am able to view the xml on the web page. But when I use the
following code, I am getting "Illegal charaters in path" message on
doc.Load, I changed the Load to LoadXml then I get bad root message.
Here is the sample code where I can make the code fail.


using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Xml;
using System.Collections;

namespace xmlreadproblem
{
class Program
{
static void Main(string[] args)
{
try
{
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
string b =
wc.DownloadString("http://tamil.taisukina.com/ServerReferenceTest.xml";);
wc.Dispose();
XmlDocument doc = new XmlDocument();
doc.Load(b);
}
catch (Exception e1)
{
string t = e1.ToString();
//TODO: Make exception more specific
}


}
}
}

Thanks for your time.


Jon wrote:
DBC User <dbcuser@xxxxxxxxx> wrote:
I have a small XML file, I uploaded to a web page. I have the following
code to convert the content I downloaded from web to xml and is giving
"Illegal characters in path", but when I try to see the value in XML
viewer (through add watch) and is showing the content correctly.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

.



Relevant Pages

  • Re: Load huge xml file
    ... I'm looking for solution/strategy how load big xml file. ... and has another elements itd. ...
    (comp.lang.java.programmer)
  • Re: xmlfile load failed
    ... according to my xmlfile load function (it ... If you know the XML file ... and if you are running under VS then the current working directory is the ... it is not clear why you are casting this HRESULT to a bool and then doing the remarkably ...
    (microsoft.public.vc.mfc)
  • Re: problem with XML DOM load command
    ... with invalid XML and I'm getting suspicious that something in a QFE ... has busted MSXML and its exception processing. ... © 2003 Microsoft Corporation. ... >> So this exception is on your main thread where you're doing the load. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Word Searching XML
    ... which will be somewhat interactive and can not expected to load ... we are trying to search XML node and its ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: Saving program state in executable
    ... UML or OWL data using XML's DOM model, it takes quite a while to load ... The overhead is mostly the textprocessing and parsing of the XML models. ... 'const' record, or set of records, at compile time, and that might be ... knows it is one block of memory (assuming it doesn't contain e.g. ...
    (comp.lang.pascal.misc)