473,804 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlDocument.Loa dXml takes forever!

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
Public Class SVG

Public Sub New()
Dim xmlstr As String = "<?xml version=""1.0"" standalone=""no ""?>" &
vbCrLf & _
"<!DOCTYPE svg PUBLIC ""-//W3C//DTD SVG 1.1//EN"" " & _
"""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd""[]>" & vbCrLf & _
"<svg version=""1.1"" xmlns=""http://www.w3.org/2000/svg"">" &
vbCrLf & _
"</svg>"
mxml = New System.Xml.XmlD ocument
mxml.LoadXml(xm lstr)
End Sub

Private mxml As System.Xml.XmlD ocument

End Class
Nov 20 '05 #1
5 1783
* "David Ricker" <da************ *@hotmail.com> scripsit:
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.

Public Class SVG

Public Sub New()
Dim xmlstr As String = "<?xml version=""1.0"" standalone=""no ""?>" &
vbCrLf & _
"<!DOCTYPE svg PUBLIC ""-//W3C//DTD SVG 1.1//EN"" " & _
"""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd""[]>" & vbCrLf & _
"<svg version=""1.1"" xmlns=""http://www.w3.org/2000/svg"">" &
vbCrLf & _
"</svg>"
mxml = New System.Xml.XmlD ocument
mxml.LoadXml(xm lstr)
End Sub

Private mxml As System.Xml.XmlD ocument


I am not familiar with .NET + XML classes, but maybe .NET tries to get
the dtd from the internet.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Cor
Yes
I am not familiar with .NET + XML classes, but maybe .NET tries to get
the dtd from the internet.

Nov 20 '05 #3
* "Cor" <no*@non.com> scripsit:
Yes
I am not familiar with .NET + XML classes, but maybe .NET tries to get
the dtd from the internet.


Do you know how to disable that?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Cor
Hi Herfried,

If I did know I had told it,

But it is not a standard Net dataset scheme I thought .

Cor
Nov 20 '05 #5
Thanks both of you for pointing this out. You are definately correct that
going out to the dtd was slowing it down. I ended up downloading the dtd
and all associated files to my server and redirected the Xml to point to my
server instead. The speed shot through the roof. Thanks to both of you for
your help.

Thanks Again,
David J. Ricker II
"Cor" <no*@non.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi Herfried,

If I did know I had told it,

But it is not a standard Net dataset scheme I thought .

Cor

Nov 20 '05 #6

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

Similar topics

6
7359
by: Yechezkal Gutfreund | last post by:
I have been using the following code (successfully) to read Xml formated text packets from a TCP stream. The output from the server stream consists of a sequence of well formed Xml documents written to the output stream. We are willing to pay $ to any expert (e.g. MVP) consultant who has to time to help us track down this problem. (we will discuss rates if you can prove your expertise, and problem solving approach).
1
17141
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 &#x1;. 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...
4
4848
by: Robert Rossney | last post by:
I'm trying to send and receive XmlDocument objects using the System.Messaging.dll functions. The code I've written follows, as best I can tell, the methodology used in the sample code for the XmlMessageFormatter class. But it isn't working -- specifically, receiving isn't working. What am I doing wrong here? I begin by creating a MessageQueue object and setting up its XmlMessageFormatter to handle XmlDocument objects: System.Type...
2
8694
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" />
2
6211
by: Dave | last post by:
Hi, Is there an easier way to pull a subset of nodes from one XmlDocument to another? I have the code below but would like to know if there is a more streamlined method. Thanks, Dave XmlNodeList nodeList = doc1.SelectNodes("//row"); foreach (XmlNode nodeCode in nodeList) { sb.Append(nodeCode.OuterXml);
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();
4
2243
by: saish | last post by:
Hello Need your help, I have a C++ win32 dll which takes xml document type by reference. I need to call this dll from c# .net. I tried using DllImport, but dll funtion when call does not respond. I tried calling similar dll for a function which take integer by refernce. It works ok in this case. Please can you let me know if we can call a c++ win32 dll function by passing a xmldocument by reference?
4
1818
by: Carlos Albert | last post by:
Hello, Would you tell me if there is a way to extract a single node as a new xmldocument? Thanks.
0
9714
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
9594
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
10599
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
10347
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
10090
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
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4308
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
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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.