problem with accessing online XML file


 
Thread Tools Search this Thread
Top Forums Programming problem with accessing online XML file
# 1  
Old 04-13-2012
problem with accessing online XML file

Hi everyone, I am trying to access an online XML file, for example: <a href="http://www.rgraph.net/sample.xml" target="_blank">
HTML Code:
http://www.rgraph.net/sample.xml
using HTML.
Code:
<html>
<body>            
 <script type="text/javascript">
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 var url = "http://www.rgraph.net/sample.xml";
xmlhttp.open("GET",url,false);   //If url is replaced by the downloaded  file named "sample.xml" this works and give the output of 1.
                                                // but works only on Mozilla
xmlhttp.send();
xmlDoc=xmlhttp.responseXML; 
 var x=xmlDoc.getElementsByTagName("stats");
alert(x.length);
 </script>
 </body>
</html>

Any comment or advice would be much appreciated!
PS: Why does this only work on Mozilla and NOT on Safari or Chrome?
Many thanks!
# 2  
Old 04-13-2012
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Xmllint - Xml-file problem --ods file not opening

Dear All, this is my first post on this Forum, glad to be here. I'm trying to fix an .ods file. Yes, I had a backup, but it's also corrupted. When opening the document I get this EM: read error format error discovered in the file in sub-document content.xml at 2,337040(row,col). So I... (3 Replies)
Discussion started by: jameslast
3 Replies

2. Shell Programming and Scripting

Problem accessing array elements

Hi all, I can’t resolve an array element access issue on (Linux/pdksh) .. So I’m positing for advice.By the way - a friend demonstrated to me - same script works as expected under Solaris. I have been working on a documentation project where many *.jpg screen shots are used in the... (4 Replies)
Discussion started by: njdpo
4 Replies

3. Shell Programming and Scripting

Cygwin vi XML file encoding problem

Hi, I have got a zip (binary) file transferred from MacOS (thus it has additional __MACOSX directory packed inside). On extracting this zip, there are few *.xml files available. When I opened this *.xml file in vim editor using Cygwin (on windows) the editor displayed in the bottom. I tried... (4 Replies)
Discussion started by: royalibrahim
4 Replies

4. Programming

Accessing environmet variable in xml file

Hi I have certain environmenet variables defined in .profile: export DBNAME="mydb" export DBHOST="devbox.us.abc.com" export DBPORT="1111" export PASSWORD="mypwd" export MMUSER="myid" I also have an xml file defined like: <CONFIG> <DEFAULTS operator="oraread"> <PROPERTY... (2 Replies)
Discussion started by: neeto
2 Replies

5. Solaris

Problem Accessing disk

Basically I´m Absolutely New to Opensolaris (Started Using It This Morning), I´m Following A Tutorial On How To Access NTFS Partitions. Device Driver Utility Finds It And Says Everythings Fine With It DISK : ST3160022ACE Capacity : 160G Driver ... (7 Replies)
Discussion started by: xXCanisLupusXx
7 Replies

6. Shell Programming and Scripting

Problem in accessing variables outside shell

Hi, I have a shell script wherein i am doing some file operations and storing the data in some variables. I am exporting these variables as i need to use them outside shell. Then within the shell i am launching GDB session hoping that i will be able to access the exported variables in the GDB... (2 Replies)
Discussion started by: jsantosh
2 Replies

7. Solaris

Problem with accessing SAN disks

Hi, I'm having a problem when attempting to define the OCR location for my 10g RAC setup on Solaris 10. I get the following error: The specified shared raw partition /dev/did/rdsk/d1s0 may not have the correct permission. Verify that the partition is owned by Oracle user. As per the Oracle10g... (15 Replies)
Discussion started by: michael.chow
15 Replies

8. Shell Programming and Scripting

Problem printing the property of xml file via shell script

Hi, I have a config.xml which cointains the tags like <CONFIG> <PROPERTY name="port" value="1111"/> <PROPERTY name="dbname" value="ABCDE"/> <PROPERTY name="connectstring" value="xyz/pwd"/> </CONFIG> This file is in some directory at UNix box. I need to write a... (4 Replies)
Discussion started by: neeto
4 Replies

9. Programming

Problem accessing struct member

I have a struct as follows... struct A { int a; ucontext_t X; //ucontext_t is another structure } How do I define a pointer to the above structure variable X of the type ucontext_t from within another function? eg. void foo() { struct A a; /////WHAT COMES IN... (1 Reply)
Discussion started by: jacques83
1 Replies
Login or Register to Ask a Question