XmlDocument.LoadXml takes forever!

  • Thread starter Thread starter David Ricker
  • Start date Start date
D

David Ricker

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
 
* "David Ricker said:
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.
 
Hi Herfried,

If I did know I had told it,

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

Cor
 
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
 
Back
Top