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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:34:06+00:00 2026-05-26T16:34:06+00:00

From my backend I retrieve a string that contains some xml data. When i

  • 0

From my backend I retrieve a string that contains some xml data. When i display this (now just with @Model.XM)L I see a nice long string that contains the xml data. Is there anyway to format this as a tree structure? Like with a jquery plugin or something? I tried some google, but couldnt find it.

On the page is also other data, it is not only the xml data.

  • 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-26T16:34:07+00:00Added an answer on May 26, 2026 at 4:34 pm

    All you need is a recursive loop that will turn child nodes of the XML document into HTML list elements. Try something like this (untested):

    var html = '<ul><li>' + xml.documentElement.nodeName + '</li>';
    var html += displayTree(xml);
    var html += '</ul>';
    
    function displayTree(xml) {
        var str = '';
        if ($(xml).children().length) {
            str += '<ul>';
            $(xml).children().each(function() {
                str += '<li>' + this.nodeName + '</li>';
            });
            str += '</ul>';
            str += displayTree(xml.childNodes);
        });
        return str;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ajax to retrieve some data from the backend. I get the result
Im getting a string (simplified) from the backend that should be : { menu:
I'm implementing a custom BCS Model to get data from a backend system. As
I have a website that needs to pull information from two diffferent XML data
I have from the backend a time on the format 00:12:54 and I display
All the generated webservice-stubs from our backend have an equals-method similar to this one:
One of our 'frontend' developers keeps requesting from us backend developers that the backend
I have a flex app that takes data from a back end database then
I want to retrieve all 4sq venues from a specific area. Now I can
I am building a small program to retrieve data from the market and chart

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.