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

  • SEARCH
  • Home
  • 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 8380573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:29:30+00:00 2026-06-09T16:29:30+00:00

I have written this XML file: <!–bookstore.xml –> <?xml version=1.0?> <!DOCTYPE reviews SYSTEM bookstore.dtd>

  • 0

I have written this XML file:

<!--bookstore.xml -->
<?xml version="1.0"?>

<!DOCTYPE reviews SYSTEM "bookstore.dtd">

<bookstore>
<location>Port Credit</location>
<address intersection="Hurontario And Lakeshore"/>
<book id="1000">
    <title> Intro to C</title>
    <copies>5</copies>
    <author name="John Fingle"/>
    <author name="Carrie Dingle"/>
<price>20.95</price>
</book>
<book id="1001">
    <title>C for Rocket Scientists</title>
    <copies>3</copies>
    <author name="Robert Johnson"/>
    <author name="B. King"/>
<price>28.95</price>
</book>
<book id="1011">
    <title>Les Miserables</title>
    <copies>5</copies>
    <author name="Victor Hugo"/>
<price>24.95</price>
</book>
</bookstore>

And I am trying to parse this by using this jQuery Method

   $(document).ready(function() {

        $.ajax({
        type : "GET",
        url : "bookstore.xml",
        dataType : "xml",
        success : processXml
        });
    });
function processXml(xml)
{
  var name = $(xml).find('location').text();
    $('#nameDiv').html(name);
}

and here is my HTML page,

<title>Untitled Document</title>
</head>
<div id="nameDiv">


</div>

<body>

</body>
</html>

I have checked my XML, HTML and jQuery methods, didn’t seem to have any mistakes. But still it is not appending the value to the div and shows a blank page. What may be wrong?

  • 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-06-09T16:29:31+00:00Added an answer on June 9, 2026 at 4:29 pm
    $(xml).find('location')[0].text();
    

    should give you what you need.

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

Sidebar

Related Questions

Hi to all, i have written something like this in the xml file <?xml
I have written a small XML validator, that takes in an XML file and
I have sample code written for parsing xml file using javax.xml package. it uses
I have written code in Java to merge two xml file, the first file
I have multiple XML files in a folder,so I written script like this to
I have written the following piece of code that reads through a given xml-file
I have written a Python script that takes a 1.5 G XML file, parses
I have written an IronPython script that generates a xml file that contains the
I have written a class to load an XML file but I always get
I have written a program that reads in a File object (really an XML

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.