tags:

views:

360

answers:

2

I've got a file with an extension of .abc which is an XML file and I am processing the XML using XSL.

I open an HTML page which loads the XML using loadXMLDoc like this:

xml=loadXMLDoc("Example.xml");  
xsl=loadXMLDoc("Example.xsl");

The problem is I need to open "Example.abc" not "Example.xml". If I try:

xml=loadXMLDoc("Example.abc");

the page loads but with no data.

Is there a way I can load the .abc file?

A: 

It is not clear exactly what you are referring to here.

Do you mean the loadXMLDoc function that is introducted here at w3Schools.com?

function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
} 

I just tried playing around with this and it works perfectly well with any file extension for the .xml - one thing I did know is that the browser was caching the html so that I had to close and reopen the page (when it was just on my desktop) to refresh the file name I had.

Could this be your issue?

David Hall
When the file is served off IIS, then the `.abc` extension must be linked with a MIME type. If it isn't, the server will simply reply 404 even it the file is there. `.abc` is typically not configured.
Tomalak
Thanks for the comment Tomalak, wasn't aware of that, it's the sort of thing I usually hit, swear about, solve, then forget until the next time :)
David Hall
A: 

Actually I had another load page but I used the W3Schools one as you suggested and yes, it works now.

Thanks for the quick reply David!

:D

Andy Select
@Andy: Please use comments to post stuff like this. It's best when you copy this to a comment beneath David's answer and then delete this "answer" of your own. Thank you. :)
Tomalak