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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:22:19+00:00 2026-05-12T09:22:19+00:00

chaning xml attributes through jquery is easy-peasy, just: $(this).attr(‘name’, ‘hello’); but how can I

  • 0

chaning xml attributes through jquery is easy-peasy, just:

$(this).attr('name', 'hello');

but how can I add another tag into the file? I tried using append the JS dies silently.

Is there any way to do this?

Clarifications: this code is part of an extension to firefox, so don’t worry about saving into the user file system. Still append doesn’t work for xml documents yet I can change xml attribute values

  • 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-12T09:22:19+00:00Added an answer on May 12, 2026 at 9:22 am

    The problem is that jQuery is creating the new node in the current document of the web page, so in result the node can’t be appended to a different XML Document. So the node must be created in the XML Document.

    You can do this like so

    var xml = $('<?xml version="1.0"?><foo><bar></bar><bar></bar></foo>'); // Your xml
    var xmlCont = $('<xml>'); // You create a XML container
    xmlCont.append(xml); // You append your XML to the Container created in the main document
    
    // Now you can append without problems to you xml
    xmlCont.find('foo bar:first').append('<div />');
    
    xmlCont.find('foo bar div'); // Test so you can see it works
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an xml file with attributes like this: <folder name = 'somename' description
I am having a strange problem. But first the orm.xml: <entity class=de.test.businessobjects.Repeat> <table name=repeat/>
I am automating changing of some XML files through documentation builder factory but in
I have some XML thus <root> <TemplateNode> <Heading> <ID>1</ID> <Name>HeadingNodeTest</Name> <Order>1</Order> <Text>This is a
I have some xml encoded as UTF-8 and I want to write this to
Probably a stupid question but so far I can't figure this out... I have
I have the following XML: <questions> <question text=This is a test question?> <answer value=Yes>
I have XML like this: <type> <mainType>...</mainType> <subtype>...<subtype> </type> The mainTypes are restricted xs:strings
I've seen plenty of posts all around about this... but I can not, for
I'm developing a plugin that has node(computer) objects with attributes like: String name String

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.