473,326 Members | 2,655 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,326 software developers and data experts.

Read an xml having URL

65
hi,

How to parse an xml which is having and Url which contains '&' sign?
I tried replacing it with & still has the same error.

my code is
Expand|Select|Wrap|Line Numbers
  1.  
  2.           var msgs = from g in xDoc.Descendants().Descendants("msgs")
  3.                            select new
  4.                            {
  5.                                messageNum = g.Element("msg_number").Value,
  6.                                message = g.Element("message").Value,
  7.                                URL = g.Element("URL").Value,
  8.                            };
  9.                 foreach (var msg in msgs)
  10.                 {
  11.                     msgList.Add(new MsgClass(msg.messageNum, msg.message, msg.URL));
  12.                 }
  13.  

Reagards
Veena
Feb 22 '11 #1
1 1382
Dormilich
8,658 Expert Mod 8TB
if the URL is hardcoded in the XML, chances are the XML is invalid (unknown entity error). if you want to write an URL into the XML, make sure the & is masked as &
Feb 22 '11 #2

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

Similar topics

12
by: Chuck Anderson | last post by:
Can anyone point me in the right direction? I want to use Php to automate confirmation of someone joining an email list by them replying to an email (so they don't have to have a browser?). I...
2
by: paul | last post by:
I am having a an issue trying to read a text file using the File.Read command. Here's the code: FileStream fs = File.Open ("somefile.xml",Open,Read,ReadWrite); StringBuilder strXml = new...
5
by: Jonathan Crawford | last post by:
Hi I am niew to pho and am having trouble with dates. I can format a date ok so $today=date('d M Y' ) gives me 2 Nov 2005 $dateval is a mysql date
1
by: SPM2 | last post by:
I have a database on one computer, and have the folder shared out. And I a have another computer linked to this database. But the problem I am having is that the 2nd computer when opening the...
6
by: BBM | last post by:
I have an object that has a fairly complex construction sequence, so I have written a dedicated "factory" class that invokes the constructor of my object class (which does nothing but instantiate...
8
by: james | last post by:
I am trying to use Filestream to read a file ( .DAT) that contains values in HEX that I want to convert to text. I know the different offset addresses for each portion of the data I am trying to...
10
by: D. Shane Fowlkes | last post by:
I have a function that is called in page_load and the purpose of this function is to look up basic data in a MSSQL table and return it in the form of a datatable. The page_load will read the data...
0
grassh0pp3r
by: grassh0pp3r | last post by:
Hello, I'm trying to make a very simple comments page on my site using PHP and am having problems somewhere. I am very new to PHP. I was able to create one that works with comments appended, but...
5
by: CSharp-Jay | last post by:
So I have been programming in C# on a personal level as of lately, and am curious about something. Lately I have been experimenting around with file create/write, etc. I can open and read the...
4
by: whygog | last post by:
Hi everyone, I'm having a pit of trouble with some c++ programming. I am trying to read in multiple strings from a file on a line, and I'm having trouble with new lines. What I am trying to do is...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.