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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:52:08+00:00 2026-06-05T18:52:08+00:00

I am evaluating certain conditions sent by a jsp page and sending the ajax

  • 0

I am evaluating certain conditions sent by a jsp page and sending the ajax response in the format as shown below.

 //Part of the response 
 response.setContentType("text/xml");
 response.setHeader("Cache-Control", "no-cache");
 response.getWriter().write("<valid>true</valid>");

I the above shown code portion i return a value true in the xml tag valid how do i return more than one piece of information in another xml tag in the same response.

I tried adding a new xml tag but it wouldn’t work.

response.getWriter().write("<valid>true</valid><name>dave</name>");

How can i return more than one piece of information in this format.
Currently its working fine if I am returning only one piece of information using the tag valid whose value is being used in the javascript code as follows.

var msg = responseXML.getElementsByTagName("valid")[0].firstChild.nodeValue;

What changes do i need to do here if i want to access the second peiece of information returned in the second xml tag.

  • 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-05T18:52:11+00:00Added an answer on June 5, 2026 at 6:52 pm

    A XML document can have only one root element but yet you’re attempting to write multiple root elements. You need to invent one common root element and use it for all XML documents. For example, <data> or <response> or whatever you like.

    response.getWriter().write("<data><valid>true</valid><name>dave</name></data>");
    

    See also:

    • A random XML tutorial
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently evaluating Selenium and it seems I'll have to perform certain steps in
I'm evaluating whether or not certain variables match expected values. The variables are set
Have you ever been frustrated by Visual Studio not re-evaluating certain watch expressions when
let's say I want to select the behaviour of a certain preprocessor directive evaluating
While evaluating the advantages and disadvantages of moving our Subversion-based repository over to Git,
When evaluating dojo.require statements, dojo tracks which modules and resources have been required and
When evaluating the success of products such as the iPhone, iPad, Google, Twitter, YouTube,
When evaluating the value of myObject.myMember My guess is that javascript will try to
I am recrusively evaluating properties via reflection using object.GetType().GetProperty(string propertyName). This is working fine
Possible Duplicate: Evaluating a string as a mathematical expression in javascript I have written

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.