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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:12:53+00:00 2026-05-30T02:12:53+00:00

I want to store an XML document in sessionStorage . When I do this

  • 0

I want to store an XML document in sessionStorage. When I do this it seems to save ok as an XMLDocument. When I try to access it (on a page refresh) the object comes back as [object Object] as opposed to [object XMLDocument].

How do I get the data out of sessionStorage as an XMLDocument (or convert it to one?)

  • 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-30T02:12:53+00:00Added an answer on May 30, 2026 at 2:12 am

    localStorage and sessionStorage can only hold strings. Have a look at the interface definition:

    interface Storage {
      readonly attribute unsigned long length;
      [IndexGetter] DOMString key(in unsigned long index);
      [NameGetter] DOMString getItem(in DOMString key);
      [NameSetter] void setItem(in DOMString key, in DOMString data);
      [NameDeleter] void removeItem(in DOMString key);
      void clear();
    };
    

    You cannot store objects unless you serialize them. So in your case, you have to serialize it to XML.

    If you received the XML document as text, just store it directly. You can use jQuery.parseXML() to parse it after retrieval.

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

Sidebar

Related Questions

I'm creating an XML document and I want to store URLs inside the a
Is this possible? Situation is that I want to store some XML in my
this is my xml document, i want to use the value of id and
I have one XML document which I want to store it inside ViewState so
I want to pass xml document to sql server stored procedure such as this:
I want to store configuration information about my DLL in an XML file inside
I want to serialize a class to xml and store that in a field
I have xml files I want to read in and store in the database.
I want to store java objects as part of the Solr document. They don't
I was planning to use an XML document to store configuration for my next

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.