473,602 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load 2 xml files on one page via javascript?

Can you load 2 xml files on an html page via javascript? I can get one
xml file to load, using the following code. How about two. I need to
combine 2 xmls files on the client. Any other way to do this?

<script type="text/javascript">
var xml = new ActiveXObject(" Microsoft.XMLDO M")
xml.async = false
xml.load("myXML .xml")
var xsl = new ActiveXObject(" Microsoft.XMLDO M")
xsl.async = false
xsl.load("myXSL .xsl")// Transform
document.write( xml.transformNo de(xsl))
</script>

Sep 8 '05 #1
1 3845
Well, just some thoughts on this.

I do load multiple XML files , but I encapsulate
all the activity into a javascript class, which
allows me to say something like...

new DCxml("somewher e.xml",MyCallba ckFunction)
new DCxml("somewher e2.xml",MyCallb ackFunction)
new DCxml("somewher e3.xml",MyOther CallbackFunctio n)

When the files or urls are loaded the callback function os called.
The only problem with this approach in your case it seems is that your
using document.write( ) , and I use post load methods like innerHTML and
such.

If you could do without the document.write, this could be solved fairly
quickly

je*********@hot mail.com wrote:
Can you load 2 xml files on an html page via javascript? I can get one
xml file to load, using the following code. How about two. I need to
combine 2 xmls files on the client. Any other way to do this?

<script type="text/javascript">
var xml = new ActiveXObject(" Microsoft.XMLDO M")
xml.async = false
xml.load("myXML .xml")
var xsl = new ActiveXObject(" Microsoft.XMLDO M")
xsl.async = false
xsl.load("myXSL .xsl")// Transform
document.write( xml.transformNo de(xsl))
</script>


--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML/CSS,Javascript, TCP ...
--`
Sep 8 '05 #2

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

Similar topics

4
2653
by: Jake Lewis | last post by:
I have an HTML page that loads fine including the .js file <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script language="JavaScript" type="text/JavaScript" src="ve3d.js" ></script> </head>
4
2707
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the source of the files...
6
2359
by: sylcheung | last post by:
Hi, How can I be notified when the document load is complet in JavaScript? I am referring to the whold document load is complete, mean all images/external files/frame/iframes have been loaded. I think there is a window.addEventListener() function but I am not sure which event to listen to. Thank you.
3
1639
by: cochrane68 | last post by:
I'm developing a web application that will be used at very high latency locations (>400ms). I have a lot of javascript files that I use in the application, and therefore often have large numbers of <scripttags on my pages. Due to the high latency at certain locations using my application, it can take a very long time for pages to load because the browser checks the server everytime to get the latest version of the script. With these...
4
2003
by: joshuaRR | last post by:
Hello all. I am trying to load a page using CSS, because the website does not allow script to be used on thier site. I was trying to enter sounds files using onmouseover on certain texts & images but the website does not allow script & deletes the scripts from being entered. I figured maybe I can load a page with the sound files in it & then for it to close itself after it plays the file or after sevral seconds. I tried placing a page with...
2
1511
by: Jeff Allan | last post by:
Hello, I am trying to load an external HTML page into a DIV tag with .NET 05 and I can't figure it out. Any suggestions? My Scenario: - Gridview populated with list of available files - I can get the external page to load in a new window just fine - I would like the detail to show on the same page, below the list. - I can't use the detail control and dynamically create the page as these
10
2227
by: nicolai | last post by:
There are plenty of scripts that load html into a page based on the day of the week, month, or randomly, but I would like to load a different page every day of the year. I would like to give a script a list of 365 html pages and have it load a new one into that page each day Thanks in advance
2
7873
by: ray | last post by:
I have a html file stored as the D:/proj/test.html. In the html file I wish to load a javascript file---test.js which is stored in the same directory as test.html. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/ <TITLE>Test Page</TITLE>
5
4745
by: memiller | last post by:
I know this generally not recommended, but I'm working in the confines of the company's intranet. Goal: permit managers to load an XML file from thier PC into an intranet ASP.NET webpage where validation and data submit will take place. I have the page written that allows the user to select a file. I'm hitting a wall when, after selecting the file, trying to open a new page and inserting the XML into the page. From there I can start...
0
7993
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8404
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8054
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8268
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5867
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.