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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:03:20+00:00 2026-05-26T04:03:20+00:00

UPDATE : Some have said that they were able to get more than 1

  • 0

UPDATE :
Some have said that they were able to get more than 1 childNode…
Here is my fiddle – I am only getting 1 childNode to display.

Where is the error?

ORIGINAL Question
Below is a partial snippet of javascript code that I have inherited. Basically this function used to get XML data by calling an AJAX function. However, due to requirement changes I am generating an XML string and storing that string in hidden input variable on the screen (Classic ASP).

After looking closer at the original script I found that it would be nice if I could somehow pass my xml string into the cmdxml variable. However, when I set cmdxml equal to my xml string: cmdxml = $.parseXML(xmlVal); and then try to use the snippet below it only gets 1 child node. I’ve included a small snippet of the xml string that I’m passing below.

Old Javascript Function (partial) using cmdxml:

    if (req.responseXML!=null) {
        var PropName;
        var PropValue;              
        var cmdxml = req.responseXML.documentElement;   
        // read each document element child node in the XML document

    for (var c =0;c<cmdxml.childNodes.length;c++) {
            var m;
            var t = cmdxml.childNodes[c];   //req.responseXML.documentElement.childNodes[c]
            if (t!=null) {
            //console.log(t.nodeName);
            switch(t.nodeName) {     //req.responseXML.documentElement.childNodes[c].nodeName
                    case "RObject": {   //response object
                        var RObject = t;    
                    //req.responseXML.documentElement.childNodes[c].nodeName.attributes[2].value
                    var CtrlChangeType = RObject.attributes[2].value;
                        var CtrlObjName = RObject.attributes[1].value;
                        var CtrlObjType = RObject.attributes[0].value;
                        var CtrlObj;

                    var RObjProp = RObject.getElementsByTagName("Property");
                    PropName =  RObjProp[0].attributes[0].value;
                        PropValue = getElementText(RObjProp[0].getElementsByTagName("Value")[0]);

                    switch (CtrlChangeType) {   //req.responseXML.documentElement.childNodes[c].nodeName.attributes[0].value
                        case "comboboxInsRow": {

Here is a snippet of my xml string that I’m passing:

<?xml version="1.0" ?><xCMDS><JCallBack ProgramName="x"><Value><![CDATA[top.closeCtrlLoading();]]></Value></JCallBack><RObject Type="E" Name="gH2ptObj_co_code" ChangeType="objProp" rowNum="" colNum=""><Property Name="value"><Value><![CDATA[]]></Value></Property></RObject>
  • 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-26T04:03:21+00:00Added an answer on May 26, 2026 at 4:03 am

    parseXML returns an XMLDocument, . You’ll need to set cmdxml zo $.parseXML(‘snippet’).documentElement to access the childNodes(childNodes is a property of nodes, usually not available in documents) .

    Your fiddle returns a childNode, but this is the root-element, you like to access the childNodes of the root-element.

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

Sidebar

Related Questions

I have some code to update a database table that looks like try {
I have to run some mysql update queries and they take quite a long
I have an update panel on my page with some links that have onClick
Common situation: I have a client on my server who may update some of
I'm trying to update some properties with KVC. The properties have been synthesized. This
I have a PL/SQL function (running on Oracle 10g) in which I update some
I'm using GNAT Programming Studio to update some ada files. I have a style
I have some tables for which I have no reason to ever update from
I'm trying to update the display brightness from a widget but i have some
UPDATE - I have fixed some mistakes in the code below and the images

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.