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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:11:04+00:00 2026-05-20T10:11:04+00:00

My problem is the following: In my javascript, I load an XML document from

  • 0

My problem is the following:
In my javascript, I load an XML document from a server.

var xmlDom =  document.implementation.createDocument("","",null);
xmlDom.async=false;
xmlDom.load("init.xml");

The user can then modify this XML Document by editing various form elements of the displayed webpage. When finished, I’d like to open a new browser tab and display the modified xml in there, so that the user can save it. The question is how to do this without sending the xmlDocument to the server and back. My current hack displays nothing on the page but at least shows the xml in the page source.

    xmlWindow = window.open("");
    xmlWindow.document.open("text/xml");
    xmlWindow.document.write(serializer.serializeToString(xmlDom));
    xmlWindow.document.close();
    xmlWindow.focus();

Someone any idea how to do this properly?

  • 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-20T10:11:05+00:00Added an answer on May 20, 2026 at 10:11 am

    Finally found a way to get what I want (at least for non-ie browsers). What I use is a so called DataUri which makes it possible to present the XML Document as a link. Clicking on the link causes the browser to process the data just as if I would load it from a server. E.g., xsl-stylesheets are processed.
    here is the (jQuery) code I’m using:

    $(‘#xmllink’).attr(‘href’,’data:text/xml,’ + xml2Str(xmlDom).replace(/”/gi, “‘”));

    the function xml2str serializes the xml Document to string.

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

Sidebar

Related Questions

I have got the following problem since the server has safe mode turned on,
Good evening everyone, I am using a JavaScript to load/override content from an HTML-File
I have the following code: <script type=text/javascript> $(function() { $('#bootChooserControl') .load('/jqia2/action/fetchBootStyleOptions'); $('#bootChooserControl').change(function(event){ $('#productDetailPane').load( '/jqia2/action/fetchProductDetails',
I have the following html + jquery: <body> <head> <script type=text/javascript src=jquery.js></script> <script> $(window).load(function()
Update: I left the following javascript code in to show how the problem developed
I've following problem, which I've not been able to do successfully. Your help will
I have the following problem: I have an HTML textbox ( <input type=text> )
I have the following problem using subversion: I'm currently working on the trunk of
I have the following problem using template instantiation [*]. file foo.h class Foo {
I have the following problem in my Data Structures and Problem Solving using Java

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.