Forum Moderators: phranque
Thanks in advance!
Karu
If you have then you could create your object in your opening template and shut it down in your closing template.
<!--#include file="TopTemplate.asp"-->
Page Content Here...
<!--#include file="BottomTemplate.asp"-->
TopTemplate.asp would include something like:
Set oXMLDict = Server.CreateObject("MyXML.Dictionary") Then load your dictionary...
BottomTemplate.asp would shut it down
Set oXMLDict = Nothing
1/ load xml object at application start
2/ extract xml as a string
3/ store resulting string as an application variable
4/ free xml object
in your pages,
1/ create xml object
2/ load xml string into object from application variable
3/ extract what you want
4/ free object
This was neccessary becasuse various threads modify the xml file. For a static file that does not get changed, it's probably not needed.
Regards,
Karu
I don't understand very well what's the difference between loading a xml file and loading a xml string each time, is one much faster than the other?.
So, I am guessing that you really want to know the difference between storing the xml dom object and storing the xml as a string. The difference is that storing the object will lock the application down to a single thread (unless it is multi-threaded). Storing the string won't.
I've read that you can store an object at application scope if the COM is free-threaded (or multi-threaded), that's why I've asked about FreeThreadedDOMDocument class.
Have you ever used it? Do you know if it solves the problem?
Here is a related link in the MS KB concerning apartment-model threading. I am pretty sure that the bit about being locked to a single thread comes from here. Btw - this encompasses any VB6 DLLs.
Thanks again for all your help!
Karu
Damn, am I ever glad I'm working with J2EE!
Not trying to start a flamewar... but are you guys sure there isn't a better way than reload the object with every call? That seems like a massive performance hazard; parsing XML into DOM is fairly heavy.