Re: Illegal Charaters in path
- From: "DBC User" <dbcuser@xxxxxxxxx>
- Date: 30 Aug 2006 09:00:16 -0700
Hi Claes,
I am getting this file from web. I am downloading this file using
webclient and how how it is adding 1 character before the actual file.
Stripping the first character solved the problem though. But why and
what is this first character?
Thanks.
Claes Bergefall wrote:
"DBC User" <dbcuser@xxxxxxxxx> wrote in message
news:1156884340.080076.56420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
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.
Here is the code
..
string b = wc.DownloadString(myurl);
XmlDocument doc = new XmlDocument();
doc.Load(str);
....
Could someone tell me what is wrong?
XmlDocument.Load doesn't have an overlaod that loads XML from a string. The
string overload expects a filename. Put your string in a StringReader and
then load from that:
XmlDocument doc = new XmlDocument();
StringReader reader = new StringReader(b);
doc.Load(reader);
When I change the Load to LoadXml I get 'Data at the root level is
invalid. Line 1, position 1"
Here is the XML
<?xml version="1.0" encoding="utf-8" ?>
<Files>
<Application key="one">
<Version>1.0</Version>
</Application>
</Files>
LoadXml works with the above XML. Not sure why you get an error
/claes
.
- Follow-Ups:
- Re: Illegal Charaters in path
- From: Richard Whitcher
- Re: Illegal Charaters in path
- From: Marc Gravell
- Re: Illegal Charaters in path
- References:
- Illegal Charaters in path
- From: DBC User
- Re: Illegal Charaters in path
- From: Claes Bergefall
- Illegal Charaters in path
- Prev by Date: Re: две формы, один dataset
- Next by Date: Re: NDoc Replacement
- Previous by thread: Re: Illegal Charaters in path
- Next by thread: Re: Illegal Charaters in path
- Index(es):
Relevant Pages
|