473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.XMLDOM")
xml.async = false
xml.load("myXML.xml")
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("myXSL.xsl")// Transform
document.write(xml.transformNode(xsl))
</script>

Sep 8 '05 #1
1 3833
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("somewhere.xml",MyCallbackFunction)
new DCxml("somewhere2.xml",MyCallbackFunction)
new DCxml("somewhere3.xml",MyOtherCallbackFunction)

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*********@hotmail.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.XMLDOM")
xml.async = false
xml.load("myXML.xml")
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("myXSL.xsl")// Transform
document.write(xml.transformNode(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
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...
4
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...
6
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. ...
3
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...
4
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...
2
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...
10
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...
2
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...
5
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.