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

XmlDocument.LoadXml 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.XmlDocument
mxml.LoadXml(xmlstr)
End Sub

Private mxml As System.Xml.XmlDocument

End Class
Nov 20 '05 #1
5 1761
* "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.XmlDocument
mxml.LoadXml(xmlstr)
End Sub

Private mxml As System.Xml.XmlDocument


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****************@TK2MSFTNGP12.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
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...
1
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...
4
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...
2
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:...
1
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...
2
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 ...
2
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
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...
4
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.