473,796 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Small doubt regarding XmlDocument::Lo adXml(String xml)

According to msdn, this method throws XmlException when
"There is a load or parse error in the XML. In this case, the
document
remains empty."

I cannot understand the difference between load and parse error.
IMO, only thing that would cause exception is Malformed xml.
right?

May 10 '07 #1
1 4167
GeezerButler wrote:
According to msdn, this method throws XmlException when
"There is a load or parse error in the XML. In this case, the
document
remains empty."

I cannot understand the difference between load and parse error.
IMO, only thing that would cause exception is Malformed xml.
right?
The XML could have a DOCTYPE declaration referencing a URL on a HTTP
server somewhere and then, if that URL is not available, you could get a
load error. At least that is what I assume the author of the
documentation had in mind when distinguishing between load and parse error.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
May 11 '07 #2

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

Similar topics

1
17140
by: Martin Honnen | last post by:
With both .NET 1.0 and 1.1 I have found the following strange behaviour where System.Xml.XmlDocument.LoadXml doesn't throw an error when parsing a text node with a character reference to an invalid characters like . Using the CreateTextNode method I create a text node containing "\u0001a" (C# string literal notation). As far as I understand the DOM allows that and an implementation is not required to throw an error. When OuterXml is...
2
8693
by: Eric Zechman via .NET 247 | last post by:
I have a project in which I get xml posted via a hidden form field (data=<xml></xml>). People are entering names like Bill & Sandy Smith. this is coming over as: <NameInfo><FamilyName><FamilyNames>David &amp; Karen</FamilyNames><Surname>Adams</Surname></FamilyName></NameInfo> When I try to load this up in a XmlDocument it blows up. string xmlData = Request.Form; dom.LoadXml(xmlData); results with this: "This is an unexpected token. The...
1
3031
by: AJ Brown | last post by:
I'm loading an XmlDocument object from a string using LoadXml. The string is a well-formed XML fragment (see example) and loads fine, however there are entities (&amp;) within attribute values. The loader parses the incoming entities and converts them to their character references automatically. How would I retain the entity? Example incoming fragment: <company name="B &amp; B Electric" />
8
6166
by: pete | last post by:
Hi there, Can someone explain to me why I can't bind to an XmlDocument but I can bind to an XmlNodeList. It's my understanding that they both implement the IEnumerable interface which is required for databinding. Am happy to work with the XmlNodeList but I can't shake the feeling I'm missing something <blush> Thanks, Pete
11
4346
by: David Thielen | last post by:
Hi; Once I have loaded an xml file into a DOM, is there any way to then get any namespace declarations that were in the xml file? Or are those just discarded as the DOM is populated? And if you can't get it from the DOM, any other way to get the namespace(s)? I'm assuming doing a SAX read which returns each element including NameSpaces and pull it form that (and build up the DOM at the same time)?
4
1664
by: Chad Scharf | last post by:
I am having difficulty taking an xml string passed as a string from a web service. I am not using SOAP, but rather calling the web service within an ASP.NET web form. Reviewing the XML object model I am only finding file parsing and I/O stream handling. Can anyone help out with how this would be done? This is just a simple test to get the returned method values which are returned from the web service as a string.
2
2762
by: Lupina | last post by:
Hi I want load whole xml file, I try do it in the same way as I did it in windows application. try { XmlDocument myDoc = new XmlDocument();
5
1782
by: David Ricker | last post by:
Hi, Does anyone have any ideas as to why the LoadXml statement in the following code takes so 8-10 seconds on a 2.4 GHz machine? Just seems to me that it should be a great deal faster. Also if there is a faster way of doing it, please let me know. Thanks, Dave
2
2528
by: ian | last post by:
Hi, I've got the weirdest garbage collection problem - I'd appreciate any advice you've got. 1. A class 'X' in a system I'm working on contains a reference to an XmlDocument, populated via LoadXML. 2. Objects of type X are reused alot so different XML is loaded numerous times. 3. If I keep this reference, the system looses more and more memory until it
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.