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 6657473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:46:21+00:00 2026-05-26T01:46:21+00:00

This isn’t really S3-specific, it’s more just a basic JavaScript question. Is there a

  • 0

This isn’t really S3-specific, it’s more just a basic JavaScript question.
Is there a way I can get JavaScript to give me a multidimensional array of all the data from an XML file? For example, say I’ve got this:

<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Name>bucketname</Name>
  <Prefix/>
  <Marker/>
  <MaxKeys>1000</MaxKeys>
  <IsTruncated>false</IsTruncated>
  <Contents>
    <Key>image.png</Key>
    <LastModified>2011-04-05T19:22:29.000Z</LastModified>
    <ETag>"53b61a2200856713abefa6949550e09a"</ETag>
    <Size>291842</Size>
    <Owner>
      <ID>
        96796a91be9047be08fae41526548b98c4499255d00abaf23f40f1d6e6398260
      </ID>
      <DisplayName>me</DisplayName>
    </Owner>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
  <Contents>
    <Key>archive.zip</Key>
    <LastModified>2011-04-29T19:05:25.000Z</LastModified>
    <ETag>"16021b5e151a69b15b4fa648a28fb112"</ETag>
    <Size>119042</Size>
    <Owner>
      <ID>
        96796a91be9023be08fae41526548b98c5699255d00aaaf23f40f1d6e6398260
      </ID>
      <DisplayName>me</DisplayName>
    </Owner>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
  <Contents>
    <Key>script.sh</Key>
    <LastModified>2011-03-11T16:02:53.000Z</LastModified>
    <ETag>"4e7ec24f635835a91663be368b372a1c"</ETag>
    <Size>124714</Size>
    <Owner>
      <ID>
        96796a91be90b5be0cfae41526548b98c4495255d00caaf23f40f1d6e6398260
      </ID>
      <DisplayName>me</DisplayName>
    </Owner>
    <StorageClass>STANDARD</StorageClass>
  </Contents>
</ListBucketResult>

I’d like to be able to iterate through each <Contents> block, and run some code based on its contents. I know this is possible, but all the tutorials I’ve seen look a lot harder than they should be.

  • 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-26T01:46:21+00:00Added an answer on May 26, 2026 at 1:46 am

    https://developer.mozilla.org/en/Introduction_to_using_XPath_in_JavaScript explains how to use XPath from JavaScript. You just need to come up with an XPath query that describes the results you wanted, and use that API to get the results.

    If you get your XML via XHR, then you already have a parsed DOM handy in the result, but if not, see XML parsing of a variable string in JavaScript

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

Sidebar

Related Questions

This isn't really a programming question but more about programming and testing tools. Is
This isn't really a programming question... Are there any ways to determine which application
This isn't a homework question, by the way. It got brought up in class
This isn't really a technical question so I apolgoise if I ruffle any feathers!
this isn't really an issue, but more of a concern that I would appreciate
This isn't a style question. Its more about the proper use of the language
This isn't a question of what stress testing tools are out there. I'm afraid
(This isn't a homework question, as it's above and beyond the class just for
This isn't a complicated question. I was just thinking through best practice and thought
Hopefully this isn't too specific/small a question, but I was wondering if anyone knew

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.