473,548 Members | 2,622 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checking when Microsoft.XMLDO M is done with XML import?

I have a web app that uses a form with its fields populated from XML
using Microsoft.XMLDO M. The problem is that Microsoft.XMLDO M functions
seem to run on their own thread, so I dont know when the fields are
done populating.

Can anyone think of a way for me to check when the following function
finishes?

function importXML(xmlQu ery,xmlSrc,xmlT arget)
{
var xmlDoc = new ActiveXObject(" Microsoft.XMLDO M");
xmlDoc.onreadys tatechange = function () {
if (xmlDoc.readySt ate == 4)
parseXML(xmlQue ry,xmlSrc,xmlTa rget,xmlDoc)
};
xmlDoc.load("ht tp://home1/sandbox/XMLResponder.ns f/XMLResponder?op enagent&frm="+
xmlSrc +"&z=.xml");
return true;
}

function parseXML(xmlQue ry,xmlSrc,xmlTa rget,xmlDoc)
{
var x = xmlDoc.getEleme ntsByTagName('f ield');
var sValue;
var sText;
for (i=0;i<x.length ;i++)
{
var row = document.create Element('TR');
for (j=0;j<x[i].childNodes.len gth;j++)
{
if (x[i].childNodes[j].nodeType != 1)
continue;
sValue =
x[i].childNodes[j].firstChild.nod eValue;
j++;
sText =
x[i].childNodes[j].firstChild.nod eValue
addOption(xmlTa rget,sText,sVal ue);
}
}
}
Jul 23 '05 #1
2 1969
jfizer wrote:
I have a web app that uses a form with its fields populated from XML
using Microsoft.XMLDO M. The problem is that Microsoft.XMLDO M functions
seem to run on their own thread, so I dont know when the fields are
done populating.

Can anyone think of a way for me to check when the following function
finishes?

function importXML(xmlQu ery,xmlSrc,xmlT arget)
{
var xmlDoc = new ActiveXObject(" Microsoft.XMLDO M");
xmlDoc.onreadys tatechange = function () {
if (xmlDoc.readySt ate == 4)
parseXML(xmlQu ery,xmlSrc,xmlT arget,xmlDoc)
};
xmlDoc.load("h ttp://home1/sandbox/XMLResponder.ns f/XMLResponder?op enagent&frm="+
xmlSrc +"&z=.xml");
return true;
}

function parseXML(xmlQue ry,xmlSrc,xmlTa rget,xmlDoc)
{
var x = xmlDoc.getEleme ntsByTagName('f ield');
var sValue;
var sText;
for (i=0;i<x.length ;i++)
{
var row = document.create Element('TR');
for (j=0;j<x[i].childNodes.len gth;j++)
{
if (x[i].childNodes[j].nodeType != 1)
continue;
sValue =
x[i].childNodes[j].firstChild.nod eValue;
j++;
sText =
x[i].childNodes[j].firstChild.nod eValue
addOption(xmlTa rget,sText,sVal ue);
}
}
}


The XML document is loaded when xmlDoc.readySta te == 4 and the fields
are populated when the parseXML function finishes.

Regards,
Steve
Jul 23 '05 #2
On Fri, 30 Jul 2004 07:07:51 GMT, Steve van Dongen
<st*****@hotmai l.com> wrote:
jfizer wrote:
I have a web app that uses a form with its fields populated from XML
using Microsoft.XMLDO M. The problem is that Microsoft.XMLDO M functions
seem to run on their own thread, so I dont know when the fields are
done populating.

Can anyone think of a way for me to check when the following function
finishes?

function importXML(xmlQu ery,xmlSrc,xmlT arget)
{
var xmlDoc = new ActiveXObject(" Microsoft.XMLDO M");
xmlDoc.onreadys tatechange = function () {
if (xmlDoc.readySt ate == 4)
parseXML(xmlQ uery,xmlSrc,xml Target,xmlDoc)
};
xmlDoc.load(" http://home1/sandbox/XMLResponder.ns f/XMLResponder?op enagent&frm="+
xmlSrc +"&z=.xml");
return true;
}

function parseXML(xmlQue ry,xmlSrc,xmlTa rget,xmlDoc)
{
var x = xmlDoc.getEleme ntsByTagName('f ield');
var sValue;
var sText;
for (i=0;i<x.length ;i++)
{
var row = document.create Element('TR');
for (j=0;j<x[i].childNodes.len gth;j++)
{
if (x[i].childNodes[j].nodeType != 1)
continue;
sValue =
x[i].childNodes[j].firstChild.nod eValue;
j++;
sText =
x[i].childNodes[j].firstChild.nod eValue
addOption(xmlTa rget,sText,sVal ue);
}
}
}


The XML document is loaded when xmlDoc.readySta te == 4 and the fields
are populated when the parseXML function finishes.

Regards,
Steve


I am aware of this, however my problem is as follows.

I have four select lists. The user can select items from list A and
add or delete them from list B. Depending on whats in list B, list C
gets populated via XML. The user can then select items from list C and
add or remove them from list D. The problem is when there are items in
list D and the user then removes an item from list B. This means that
list C changes and I need to make sure that the selected items that
got inserted into list D are still in list C. I've not been able to
find a way to do this because I dont know when list C is done being
populated.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2063
by: kmunderwood | last post by:
I am trying to combine "if match=" and "when test" I am a newbie, and have made both work separately, but I can not seem to combine them. This is my xml("index.xml")page(I can not change this, it comes to me this way. <?xml version="1.0" encoding="iso-8859-1" ?>
5
1292
by: jon morgan | last post by:
Hi, I am trying to clean out all the VB specific code in a project before porting to C#. Having removed all the import references I still see the VB runtime is loaded at startup. How can I pin down what is actually causing the VB runtime still to load? Thanks for any help.
67
4196
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++....
1
1905
by: Dave Romig | last post by:
Can anyone provide guidance for saving and restoring an XMLDOM object as a binary blob? In a VB application, I need to repeatedly save and restore a large, dynamic XML document. Currently, the CPU overhead of serialization and de-serialization is KILLING performance. I have done some tests and if I could persist the DOM as a binary blob, I...
5
1818
by: Dikkuuhh | last post by:
I must get a lot of information out of my database into a XMLDOM. The database part is done, all the information is in SQLDataReaders, but how can i convert all that information into a XMLDOM?? I must get it nice so i can load the information later.. Greetz Koen
8
3150
by: J-P-W | last post by:
Hi, anyone got any thoughts on this problem? I have sales reps. that remotely send their data to an ftp server. The office downloads all files, the code creates an empty file, then downloads the data to it, then moves on to the next rep: ---------- conTARGETVisits = FTPLocation & "RepCallPlan" & Format(MyRepCode, "00")
16
3500
by: Claudio Grondi | last post by:
Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of instructions which can sure be optimized away is the check for the break condition, at least within the time where it is known that the loop will not...
0
2057
by: =?Utf-8?B?TWF0dCBDYWxob29u?= | last post by:
HI there, I am getting an error on my page which calls up a web service. Microsoft VBScript runtime error '800a13ba' Unknown runtime error: 'SearchQueryXML' /SearchResults.asp, line 142
1
4203
AnuSumesh
by: AnuSumesh | last post by:
Hi, I want to read the text property of XML file. My xml file is as follows: <?xml version="1.0"?> <Domain_Credentials> <User> anu </User>
0
7512
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.