Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3695218
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:35:29+00:00 2026-05-19T04:35:29+00:00

Im trying to work with following code i getting this error at xsltProcessor.importStylesheet Error

  • 0

Im trying to work with following code i getting this error at xsltProcessor.importStylesheet

Error when i removed: xhttp.send(null);

uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIXSLTProcessor.importStylesheet]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: file:///C:/Users/bobby/Desktop/geocoding.html :: displayResult :: line 35"  data: no]

Line 0

Error when i have: xhttp.send(null);

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///C:/Users/bobby/Desktop/geocoding.html :: loadXMLDoc :: line 16"  data: no]

Line 0

My html file:

<html>
<head>
<script>
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET",dname,false);

return xhttp.responseXML;
}

function displayResult()
{ 
xml=loadXMLDoc("http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false");
alert("successful call to xml");
xsl=loadXMLDoc("latitude.xsl");
alert("successful applying style sheet");
// code for IE
if (window.ActiveXObject)
  {
  ex=xml.transformNode(xsl);
  document.getElementById("example").innerHTML=ex;
  }
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
  {
  xsltProcessor=new XSLTProcessor();
  xsltProcessor.importStylesheet(xsl);
  resultDocument = xsltProcessor.transformToFragment(xml,document);
  document.getElementById("example").appendChild(resultDocument);
  }
}
</script>
</head>
<body onload="displayResult()">
<div id="example" />
</body>
</html>

My Xslt style sheet as requested:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/"> 
  <html>
  <body>
  <h2>Latitude Longitute finder</h2>
  <table border="1">
    <tr bgcolor="#9acd32">
      <th>Latitude</th>
      <th>Longitude</th>
    </tr>
    <tr>
      <td><xsl:value-of select="GeocodeResponse/result/geometry/location/lat"/></td>
      <td><xsl:value-of select="GeocodeResponse/result/geometry/location/lng"/></td>
<td><xsl:value-of select="GeocodeResponse/result/type"/></td>
<td><xsl:value-of select="GeocodeResponse/result/formatted_address"/></td>
<td><xsl:value-of select="GeocodeResponse/result/address_component/long_name"/></td>
<td><xsl:value-of select="GeocodeResponse/result/address_component/short_name"/></td>
    </tr>
  </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:35:30+00:00Added an answer on May 19, 2026 at 4:35 am

    Well unless your HTML document with the script is hosted on http://maps.googleapis.com/ your script is not allowed to load documents with XMLHttpRequest from that origin, due to the same origin policy in place for client-side code in browsers. So I would expect a browser like Mozilla to throw an exception on the send call if you are trying to load data from http://maps.googleapis.com/.
    As for the error on the importStylesheet, consider to show a minimal but complete stylesheet allowing us to reproduce the error. Or better yet, first run the stylesheet outside of the browser through an XSLT 1.0 processor which gives you better error messages, I suspect there is simply a problem in the stylesheet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just trying to work out why the following code is leaking memory and
I am trying to add the following code work in a php file but
I'm trying to get the following code to work using both Watin and HttpWatch.
I am trying to get the following code to work: if (isset($_POST['file'])){ if(file_exists($_POST['file'])){ echo
I'm trying to get HTML5's audio tag to work in Chrome. The following code
I have the following jquery code which doesn't work quite right when trying to
I am getting the following error when trying to attach an object that is
I am having this odd error with my code. I am trying to troubleshoot
I am trying to use the following but I keep getting an error or
i am trying to work out the following problem in Java (although it could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.