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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:31:09+00:00 2026-05-25T23:31:09+00:00

I have a response that comes from server side in xml format (partial like

  • 0

I have a response that comes from server side in xml format (partial like below)

<list>
    <Response>
        <cfgId>903</cfgId>
        <recommendations>
            &lt;Rule&gt;
            &lt;name&gt;Env SSA_RB_RESTART&lt;/name&gt;
            &lt;category&gt;none&lt;/category&gt;
            &lt;severity&gt;warning&lt;/severity&gt;
            &lt;ruleEvalResult&gt;true&lt;/ruleEvalResult&gt;
            &lt;actionResult&gt;Setting SSA_RB_RESTART=0 will cause RuleBase corruption.Kindly unset this environment variable and
            restart the IIR server&lt;/actionResult&gt;
            &lt;/Rule&gt;
        </recommendations>
    </Response>
    <Response>
        <cfgId>903</cfgId>
        <recommendations>
            &lt;Rule&gt;
            &lt;name&gt;SSAOPTS (+Ltd) setting&lt;/name&gt;
            &lt;category&gt;none&lt;/category&gt;
            &lt;severity&gt;warning&lt;/severity&gt;
            &lt;ruleEvalResult&gt;true&lt;/ruleEvalResult&gt;
            &lt;actionResult&gt;
            Please note that it is not recommended to have SSAOPTS=+Ltd in case of the 
            Production environment.&lt;/actionResult&gt;
            &lt;/Rule&gt;
        </recommendations>
    </Response>
</list>

update

I get the main Response tag with xml=$(xmldata); var resp_x = $(xml).find('Response').text(); and then I am trying to replace with below

resp_x = resp_x.replace(/&lt;/g,"<");
resp_x = resp_x.replace(/&gt;/g,">");
var rule_x = $(resp_x).find('name').text();
alert(rule_x);

but it gives me blank, please help me fetch severity.

UPDATE with my answer

var xmlString=xmlToString(xmldata);
                xmlString=xmlString.replace(/(&lt;)/g,"<").replace(/(&gt;)/g,">");

                xml=StringtoXML(xmlString);

 //now I can do my operations here
 $(xml).find('Response').each(function(){
   console.debug($(this).find('severity').text());
 });


function xmlToString(xmlObj) {
if (navigator.appName == "Netscape")
{
   return (new XMLSerializer()).serializeToString(xmlObj);
}
if (navigator.appName == "Microsoft Internet Explorer")
{
    return xmlObj.xml;
}
}

function StringtoXML(text){
if (window.ActiveXObject){
  var doc=new ActiveXObject('Microsoft.XMLDOM');
  doc.async='false';
  doc.loadXML(text);
} else {
  var parser=new DOMParser();
  var doc=parser.parseFromString(text,'text/xml');
}
return doc;
}
  • 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-25T23:31:10+00:00Added an answer on May 25, 2026 at 11:31 pm

    You’re converting the returned XML to a jQuery object too early and then doing the replace wrong. Try something like this:

    $.ajax({
        url: 'list.xml',
        dataType: 'text',
        success: function(data) {
            console.debug(data);
    
            data = data.replace('&lt;', '<', 'gm')
                       .replace('&gt;', '>', 'gm');
    
            console.debug(data);
    
            var $severities = $(data).find('severity');
    
            console.debug($severities);
        }
    });
    

    In the replace(), you need both the g (global) and m (multi-line) flags. See the documentation on String.replace() for details.

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

Sidebar

Related Questions

I have a JSON response that is formatted from my C# WebMethod using the
I have response stream from a ftp web request that returns binary file. I
I have an odd edge case right now in that a response code from
I have an HTTP server that returns large bodies in response to POST requests
I'm trying to generate a JSON response that includes some HTML. Thus, I have
i have a treview control with drag&drop functionality that response to draw the node
I have application that brings response via Ajax and creates 5-20 new jQuery click
I have a resource handler that is Response.WriteFile(fileName) based on a parameter passed through
I have an asp page that loads a response user=exists everytime I try to
I have a webrequest that returns a html response which has form inside with

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.