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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does XML.Load lock the XML file or create a copy in memory?

Status
Not open for further replies.

neualex

Programmer
Feb 26, 2008
53
US
Hi folks,

I'd like to double check if when running the LOAD method below, does the XML file get locked while the script is running or until myXML is set to NOTHING?
Or LOAD makes a copy of the XML in memory to work with?

Set myXML = CreateObject("Microsoft.XMLDOM")
myXML.async = "false"
myXML.load("demo.xml")

Please let me know.
Thanks!

...Alex
 
>...get locked while the script is running or until myXML is set to NOTHING?
No. (Double check what?)
 
So, it the entire XML file IS loaded in memory for manipulation?

...Alex
 
Set myXML = CreateObject("Microsoft.XMLDOM")
This is exactly the moment you determine this.
DOM means document object model; parsing XMLs using DOM means loading the entire file into memory then parsing that stored structure. It does not lock the file. It only reads from the file and then is completely detached from it.

As long as you don't work with really large XMLs, DOM is perfectly fine. You can imagine though that parsing very large XMLs poses a problem as the entire structure must be loaded and kept in memory.

For very large XMLs, SAX is usually more practical.

;-)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top