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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:06:11+00:00 2026-06-05T02:06:11+00:00

I have an XML file that contains one set of data and this has

  • 0

I have an XML file that contains one set of data and this has to be represented in one of the many dojo content panes of a HTML page. I’ve tried dojox.grid.DataGrid and it works; however since the data grid is used to generally represent tabular data, I don’t want to use data grid.

Is there any other way to represent this data in a simple format?

The XML file is something like this:

<Summary>
   <neName>abc</neName>
   <neType>pqr</neType>
   <neRelease>2.0</neRelease>
   <neAddress>10.10.82.105</neAddress>
   <supervisionState>SUPERVISED</supervisionState>
   <operationalState>ENABLED</operationalState>
   <alignmentState>ALIGNED</alignmentState>
   <criticalAlarms>0</criticalAlarms>
   <majorAlarms>0</majorAlarms>
   <minorAlarms>0</minorAlarms>
   <noOfShelves>5</noOfShelves>
</Summary>

I want this data to be represented something like this:

enter image description here

  • 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-05T02:06:13+00:00Added an answer on June 5, 2026 at 2:06 am

    If you’re feeling frisky, you can make a sort-of generic, XML data widget. Here’s an example I have from some time ago.

    dojo.declare("foo.XmlDisplay", dijit._Widget, {
    
        postCreate: function()
        {
            this.inherited(arguments);
            dojo.xhrGet({
                url: this.href,
                handleAs: "xml",
                load: dojo.hitch(this, "setData")
            });
    
        },
    
        setData: function(data)
        {
            // All items with a xmldisp-tag attribute should get data
            dojo.query("*[data-xmldisp-tag]", this.containerNode).forEach(
                function(item) {
                    var tag   = dojo.attr(item, "data-xmldisp-tag");
                    var value = data.getElementsByTagName(tag);
                    if(value.length == 1) item.innerHTML = value[0].textContent;
                    else console.warn("No data in xml for",tag);
                }
            );
        }
    });
    

    You can then use it something like this in your HTML (i.e. the widget doesn’t care how you display the data, it just uses the given tag names to lookup data in the XML from the server):

    <div data-dojo-type="foo.XmlDisplay" href="/MyXmlStuff?id=42">
        <dl>
            <dt>NE name</dt><dd data-xmldisp-tag="nename">-</dd>
            <dt>NE type</dt><dd data-xmldisp-tag="netype">-</dd>
        </dl>
        <dl>
            <dt>Alarms</dt><dd data-xmldisp-tag="majoralarms">-</dd>
            <dt>Minor</dt><dd data-xmldisp-tag="minoralarms">-</dd>
        </dl>
    </div>
    

    Here’s a modified jsfiddle you can try: http://fiddle.jshell.net/K4UnJ/3/

    Not sure if this fits your task at all, but since I had very similar code lying around, I thought I’d share.

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

Sidebar

Related Questions

I have generated an XML file that and one of the nodes contains data
I have an xml file that contains a structure.. In this structure, I have
For an XML file I am creating I have data that contains a bullet
I have a web application, that contains a configuration xml file for one of
I have an xml file that contains its element like <ab:test>Str</ab:test> When I am
I have an XML file format that contains a structure of questions: <question id=q101>
I have been provided an XSD and a sample Xml file that contains the
I have an XML file that reads like this <abc> <ab>value</ab> <aa>time</aa> <ac>money</ac> </abc>
I have an XML file that already contains a reference to an XSLT file.
I have a dynamically created xml file that contains a record with five descriptor

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.