473,386 Members | 1,743 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,386 software developers and data experts.

XmlDoucment loading error

The & is valid in a xml document and the xml string
you specified is valid. I checked this in my IE! I dont
understand where the error comes from! The code and the
xml string you provided should work.
Sonu Kapoor
Blog: http://weblogs.asp.net/sonukapoor/
-----Original Message-----
I am working on a project where I get xml from a third party vendor. They post a string of Xml to me in a hidden
form field, so the post is like, XmlData=<bla></bla>.
People are entering names like Bill & Suzy Smith. So when
that comes across it is Bill & Suzy. I go to pull that
into an XmlDocument and I get the following error:
XmlDocument dom = new XmlDocument();
string xmlData = Request.Form["RequestData"];
dom.LoadXml(xmlData);

This is an unexpected token. The expected token is 'EndElement'. Line 1, position 1022.
here is the node that causes the error:
<NameInfo><FamilyName><FamilyNames>David & Karen</FamilyNames><Surname>Adams</Surname></FamilyName></N
ameInfo>
I really don't want to put some hack in there like replace every & with a + or something like that.
--------------------------------
From: Eric Zechman

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>z/nsm2NM8ECwSTofopcWfw==</Id>
.

Nov 12 '05 #1
0 983

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
0
by: RK | last post by:
Hello I am using Microsoft Development Environment 2003 Version 7.1.3088 & Framework 1.1.4322 and developing Windows Forms using Visual C#. It was working fine for quite a month. Currently...
1
by: Jigar Mehta | last post by:
Hye friends!! Jigar Mehta from India. Currently I am loading one BMP file around 2.5 MB from the disk from my VC program and show it to its DC... But while CBitmap object tries to load it by...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
0
by: Erwan | last post by:
I have a strange (but very blocking) result when using the smtpmail class from an ASPX page : here is the (very simple !) code... '-------------------------------------------------- mail.To =...
1
by: campwes | last post by:
Hey, all! We're having trouble displaying SQL Server data in a web site as XML, using a transform. The query is a simple SELECT statement. When running the query, we get the following error from...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
1
by: FreeXenon | last post by:
OK, I am having a lot of problems loading an XML file via a Server-Side JavaScript based ASP page. Below is the code that I am using as well as the different methods of loading the XML file and the...
0
by: pinky22 | last post by:
I am calling SSIS package from a .Net windows UI. Both SSIS & .Net app are created in 2008. The SSIS package is stored in file system. When I ran .Net app I got error- The package failed to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.