473,657 Members | 2,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System error when loading xml document

Hello,

When I load an XML document using the LoadXml function, I get a "System
error" exception raised.

What causes this? the XML document is valid.

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@h eadfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com
-
Nov 12 '05 #1
12 8581


Simon Jefferies wrote:

When I load an XML document using the LoadXml function, I get a "System
error" exception raised.

What causes this? the XML document is valid.


LoadXml doesn't validate at all so validity is not relevant.
I guess you do not get the System error with any attempt to use LoadXml
but with a specific input string parameter. Could you post that here if
it is short or otherwise maybe put it in a text file, upload that to a
server and post the URL?
Also tell us whether you are using .NET 1.0 or 1.1.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #2


Simon Jefferies wrote:

When I load an XML document using the LoadXml function, I get a "System
error" exception raised.

What causes this? the XML document is valid.


LoadXml doesn't validate at all so validity is not relevant.
I guess you do not get the System error with any attempt to use LoadXml
but with a specific input string parameter. Could you post that here if
it is short or otherwise maybe put it in a text file, upload that to a
server and post the URL?
Also tell us whether you are using .NET 1.0 or 1.1.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3
Hi Simon,

I've test the Xml file you provided. It seems that the cause is just the
XML file is not valid event not well-formed. Generally, we can first open a
xml file in IE browser to see whether it can be correctly displayed so as
to confirm whether it is well-formed.

#Checking for Well-Formed and Valid XML
http://msdn.microsoft.com/library/en...ngforwell-form
edvalidxml.asp? frame=true

#Well-Formed XML Creation with the XmlTextWriter
http://msdn.microsoft.com/library/en...-FormedXMLCrea
tionWithXmlText Writer.asp?fram e=true

After that we can use api to processing the XML document. I've attached the
modified Xml file in this message. Please have a check to see whether it
works. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 12 '05 #4
Hi Simon,

I've test the Xml file you provided. It seems that the cause is just the
XML file is not valid event not well-formed. Generally, we can first open a
xml file in IE browser to see whether it can be correctly displayed so as
to confirm whether it is well-formed.

#Checking for Well-Formed and Valid XML
http://msdn.microsoft.com/library/en...ngforwell-form
edvalidxml.asp? frame=true

#Well-Formed XML Creation with the XmlTextWriter
http://msdn.microsoft.com/library/en...-FormedXMLCrea
tionWithXmlText Writer.asp?fram e=true

After that we can use api to processing the XML document. I've attached the
modified Xml file in this message. Please have a check to see whether it
works. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 12 '05 #5
Hello,

I'm a bit confused as I've tried the original XML file in IE and it loads
correctly and I've stripped it down to the root item and it still fails.

I've looked at the attachment you've added, what did you change as I
couldn't see any changes in it?

Thanks
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@h eadfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com
-
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:IA******** *****@cpmsftngx a10.phx.gbl...
Hi Simon,

I'm sorry to miss the attachment in the last message. Here is the xml file
in attachement. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 12 '05 #6
Hello,

I'm a bit confused as I've tried the original XML file in IE and it loads
correctly and I've stripped it down to the root item and it still fails.

I've looked at the attachment you've added, what did you change as I
couldn't see any changes in it?

Thanks
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@h eadfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com
-
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:IA******** *****@cpmsftngx a10.phx.gbl...
Hi Simon,

I'm sorry to miss the attachment in the last message. Here is the xml file
in attachement. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 12 '05 #7
Hi Simon,

Here is the original Xml file you've attached:
=============== ============
<Items>
<Item Type="MenuSyste mPage">
<MenuSystemObje ct Name="Unnamed Page" />
<MenuSystemPa ge ID="1">
<MenuSystemPage Item RefID="2" X="0.5" Y="0.5" Width="0.5"
Height="0.5">
<Normal EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<NormalColor1 Red="205" Green="205" Blue="205" Alpha="205" />
<NormalColor2 Red="205" Green="205" Blue="205" Alpha="205" />
</Normal>
<Focused EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<FocusedColor 1 Red="205" Green="205" Blue="205" Alpha="205" />
<FocusedColor 2 Red="205" Green="205" Blue="205" Alpha="205" />
</Focused>
<Selected EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<SelectedColo r1 Red="205" Green="205" Blue="205" Alpha="205" />
<SelectedColo r2 Red="205" Green="205" Blue="205" Alpha="205" />
</Selected>
</MenuSystemPageI tem>
</MenuSystemPage>
</Item>
<Item Type="MenuSyste mText">
<MenuSystemObje ct Name="Unnamed Item" />
<MenuSystemIt em ID="2" />
<MenuSystemTe xt LanguageFilenam e="" LanguageID="0"
LastLanguageTex t="HELLO WORLD" />
</Item>
</Item

=============== =============== ============

The end tag of the root element has been corrupt and after correct it, I
can load it correctly. I test via C# code. Can you correctly load the
XmlDocument via C# code? Or is there anything else cause the problem?
Please have a try and let me know if you have any futher finding. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 12 '05 #8
Hi Simon,

Here is the original Xml file you've attached:
=============== ============
<Items>
<Item Type="MenuSyste mPage">
<MenuSystemObje ct Name="Unnamed Page" />
<MenuSystemPa ge ID="1">
<MenuSystemPage Item RefID="2" X="0.5" Y="0.5" Width="0.5"
Height="0.5">
<Normal EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<NormalColor1 Red="205" Green="205" Blue="205" Alpha="205" />
<NormalColor2 Red="205" Green="205" Blue="205" Alpha="205" />
</Normal>
<Focused EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<FocusedColor 1 Red="205" Green="205" Blue="205" Alpha="205" />
<FocusedColor 2 Red="205" Green="205" Blue="205" Alpha="205" />
</Focused>
<Selected EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<SelectedColo r1 Red="205" Green="205" Blue="205" Alpha="205" />
<SelectedColo r2 Red="205" Green="205" Blue="205" Alpha="205" />
</Selected>
</MenuSystemPageI tem>
</MenuSystemPage>
</Item>
<Item Type="MenuSyste mText">
<MenuSystemObje ct Name="Unnamed Item" />
<MenuSystemIt em ID="2" />
<MenuSystemTe xt LanguageFilenam e="" LanguageID="0"
LastLanguageTex t="HELLO WORLD" />
</Item>
</Item

=============== =============== ============

The end tag of the root element has been corrupt and after correct it, I
can load it correctly. I test via C# code. Can you correctly load the
XmlDocument via C# code? Or is there anything else cause the problem?
Please have a try and let me know if you have any futher finding. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 12 '05 #9
Thanks for your reply,
The end tag of the root element has been corrupt and after correct it, I
can load it correctly. I test via C# code. Can you correctly load the
XmlDocument via C# code? Or is there anything else cause the problem?
Please have a try and let me know if you have any futher finding. Thanks
I have no corruption at my end on the end tag of the root element, I have
created a basic XML file containing just the following:

<Items></Items>

and this failed too.

I get a problem with reading the file using VB, C# and Managed C++ code.

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@h eadfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com
-
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:Pu******** ******@cpmsftng xa10.phx.gbl... Hi Simon,

Here is the original Xml file you've attached:
=============== ============
<Items>
<Item Type="MenuSyste mPage">
<MenuSystemObje ct Name="Unnamed Page" />
<MenuSystemPa ge ID="1">
<MenuSystemPage Item RefID="2" X="0.5" Y="0.5" Width="0.5"
Height="0.5">
<Normal EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<NormalColor1 Red="205" Green="205" Blue="205" Alpha="205" />
<NormalColor2 Red="205" Green="205" Blue="205" Alpha="205" />
</Normal>
<Focused EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<FocusedColor 1 Red="205" Green="205" Blue="205" Alpha="205" />
<FocusedColor 2 Red="205" Green="205" Blue="205" Alpha="205" />
</Focused>
<Selected EaseInTime="1" TimesPerSecond= "1" Scale1="1" Scale2="1"
ColorPulsate="0 " SizePulsate="0" UVPulsate="0" PositionThrob=" 0"
UVThrob="0" ColourAnimate=" 0" PositionAnimate ="0" UVAnimate="0">
<SelectedColo r1 Red="205" Green="205" Blue="205" Alpha="205" />
<SelectedColo r2 Red="205" Green="205" Blue="205" Alpha="205" />
</Selected>
</MenuSystemPageI tem>
</MenuSystemPage>
</Item>
<Item Type="MenuSyste mText">
<MenuSystemObje ct Name="Unnamed Item" />
<MenuSystemIt em ID="2" />
<MenuSystemTe xt LanguageFilenam e="" LanguageID="0"
LastLanguageTex t="HELLO WORLD" />
</Item>
</Item

=============== =============== ============

The end tag of the root element has been corrupt and after correct it, I
can load it correctly. I test via C# code. Can you correctly load the
XmlDocument via C# code? Or is there anything else cause the problem?
Please have a try and let me know if you have any futher finding. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 12 '05 #10

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

Similar topics

1
2345
by: Andrew V. Romero | last post by:
I have a script that I am working on for an intranet tool and in this script I have a form, which when submitted the onSubmit command calls calculate(). In this calculate function, I have it do some calculations and write out a new document using document.write(). One of the lines it writes is (the whole script is at the bottom of this email). pageData = PageData+"<b>Patient Data</b><br>Wt: "+weight+" "+weightUnits+" &nbsp&nbsp Ht:...
18
1801
by: Geoff Cox | last post by:
Hello, I am trying to print out the array values for a second time but get error on page message? Thanks Geoff <html>
1
1402
by: torbs | last post by:
I am trying to use the methods in quicktimes plugin, but IE generetes an error. I have tried to use the "document.all" instead of getElementById but the results remain the same. It won't recognise "movie1" and "movie2" as objects, and it won't allow me to use their methods. And of course IE generates an error message that says nothing about what might be wrong.
0
415
by: Simon Jefferies | last post by:
Hello, When I load an XML document using the LoadXml function, I get a "System error" exception raised. What causes this? the XML document is valid. Regards Simon Jefferies Tools Programmer, Headfirst Productions
17
4603
by: rox.scott | last post by:
Can someone please explain why this happens? The expected output is 3, but uncommenting line 7 makes the output 0. Why ??? VB.NET code: ** note the commented line, this is the culprit ** Dim xsl As New System.Xml.Xsl.XslTransform() Dim xw As New System.IO.StringWriter() Dim xmldoc As New System.Xml.XmlDocument() Dim xsldoc As New System.Xml.XmlDocument() xmldoc.Load("test.xml")
0
1572
by: Deep Purple | last post by:
I started with the following error... ------------------------------------------------------- An error occured while loading the schema with TargetNamespace 'http://www.w3.org/2001/XMLSchema' referenced in this document. The value for the 'base' attribute is invalid - 'xsd:string' is an invalid value for the 'base' attribute. An error occured at the file:///C:Program Files/Microsoft Visual Studio .NET 2003...
0
1549
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 while opening the c# project the designer started giving lot many errors. The compiled exe, before the last project closing is still working as desired. The following are the problems. 1. A class file shows error in the Solution Explorer, also...
3
3600
by: Mike Owen | last post by:
I have just tried to open a the file "Controls/CreateEditPost.cs" from within Visual Studio .Net, and the error message: 'An error occurred while loading the document. Fix the error, and then try loading the document again. The error message follows: An exception occurred while trying to create an instan of System.Web.UI.WebControls.WebControl. The exception was "Constructor type System.Web.UI.WebControls.WebControl not found" '
1
1697
by: Greg Collins [Microsoft MVP] | last post by:
I have a site that uses a custom 404 error page to perform URL Rewriting. This works excellent for all my needs except for one area. When transforming XML, I have some XSLT code that uses the document() function to load some dynamic XML from a SQL database via an ASP.NET page. I am able to get this to work by calling the rewritten URL via an HTTP call--for example: document('http://site/fakefile.xml"). For a while now I have been trying to...
0
8425
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8845
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...
0
8743
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
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
8622
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...
0
5647
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
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
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
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.