Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML load method fails with error

Status
Not open for further replies.

dotolee

Technical User
Jan 27, 2008
134
CA
i have an svg file that I'm trying to load as an xml document. i create an msxml2.domdocument.3.0 object and try to load the svg file in to read it.

it's failing with the error:

the system cannot locate the resource specified. Error processing resource '
it's dying on my <!Doctype svg PUblic "-//w3c//dtd svg 1.1//en" " line in my svg file.

any suggestions?
 
in case it helps, my code looks like:
set mysvg = server.createobject("msxml2.domdocument.3.0")
mysvg.async=false
mysvg.load("d:\svg\dev\test.svg")
for each element in mysvg.getElementsByTagName("text")

etc...
next

it's on the load that it dies.
I've tried removing the doc type tag as well, which seems to load the file, (i added an "mysvg.save" immediately after the load and saved to another file. the new file and original look identical) but later on when i try to use the getElementsByTagName method, it fails saying that there is no object.
thanks.
 
On the assumption that you're working on v3.0, as we're told, you should:
[1] set the resolveExternals to false
[2] you still can use getElementsByTagName("text") even it is lived in some (default) namespace.
[tt]
set mysvg = server.createobject("msxml2.domdocument.3.0")
[red]mysvg.resolveExternals=false[/red]
mysvg.async=false
mysvg.load("d:\svg\dev\test.svg")
for each element in mysvg.getElementsByTagName("text")
'etc...
next
[/tt]
ps: There are intriguing details to take care when you're working with later versions. Version 3.0 is good enough until you might encounter the need of other functionality that it does not support.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top