Re: Illegal Charaters in path
- From: "DBC User" <dbcuser@xxxxxxxxx>
- Date: 30 Aug 2006 07:34:27 -0700
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
.
- Follow-Ups:
- Re: Illegal Charaters in path
- From: DBC User
- Re: Illegal Charaters in path
- References:
- Illegal Charaters in path
- From: DBC User
- Re: Illegal Charaters in path
- From: Jon Skeet [C# MVP]
- Re: Illegal Charaters in path
- From: DBC User
- Illegal Charaters in path
- Prev by Date: return type of web method should be a class object in web service
- Next by Date: Database testing with automated verifications of your modifications ?
- Previous by thread: Re: Illegal Charaters in path
- Next by thread: Re: Illegal Charaters in path
- Index(es):
Relevant Pages
|