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

  • Home
  • SEARCH
  • 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 8252075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:26:50+00:00 2026-06-08T00:26:50+00:00

I am trying to parse the following xml (after hosting in my local machine)

  • 0

I am trying to parse the following xml (after hosting in my local machine) and load it to store.

<?xml version="1.0" encoding="UTF-8"?>
<users>
    <user>
       <id>2</id>
       <name>shameel</name>
       <post>
         <user_id>5</user_id>
         <title>programmer</title>
         <body>nothing</body>
       </post>
       <post>
         <user_id>6</user_id>
         <title>newpost</title>
         <body>congrats</body>
       </post>
    </user> 
<user>
       <id>3</id>
       <name>abdulls</name>
       <post>
         <user_id>5</user_id>
         <title>programmer1</title>
         <body>nothing1</body>
       </post>
       <post>
         <user_id>6</user_id>
         <title>newpost1</title>
         <body>congrats1</body>
       </post>
       <post>
         <user_id>7</user_id>
         <title>newpost1</title>
         <body>congrats1</body>
       </post>
    </user>       
</users>

The models used are as follows:

Ext.define("SectionModel", {
            extend : 'Ext.data.Model',
            config : {
                fields : [{
                            name : 'section',
                            type : 'string',
                            mapping : '@section'
                        }],
                proxy : {
                    type : 'ajax', 

                     url : 'http://localhost:8080/sample1.xml', //sample1.xml is the file

                    reader : {
                        type : 'xml',
                        rootProperty : 'configs',
                        record : 'navigation'
                    }
                },

                hasMany : [{
                    model : 'ArticlesModel',
                    name : 'articlesModel',
                         associationKey:'sections'

                    }]



            }
        });










Ext.define("ArticlesModel", {
            extend : 'Ext.data.Model',
            config : {
                fields : [{
                        name : 'title',
                        type : 'string',
                        mapping : '@title'
                    }, {
                        name : 'value',
                        type : 'string',
                        mapping : '@value'
                    }],

                    proxy : {
                    type : 'ajax',
                                        url : 'http://localhost:8080/sample1.xml', //sample1.xml is the file
                    reader : {
                        type : 'xml',
                        rootProperty : 'navigation',
                        record : 'section'
                    }
                },

                belongsTo : 'SectionModel'


            }
        });

Store used as below:

Ext.define("SectionStore", {
            extend : 'Ext.data.Store',

            config : {
                model : 'SectionModel',
                autoLoad : 'true'



            }
        });

I try to access the content as below:

var store = Ext.data.StoreManager.get('SectionStore');
        if (!store) {
            console.log("Store not found");
            return;
        }

store.load(function(records, operation, success) {
                    for (var i = 0; i < store.getCount(); i++) {
                        var section_title = store.getAt(i).get('section');
                                                var subsection_val = store.getAt(i).articlesModel().get('title');//this function fails saying no "get" function for the object
}
});

Here I am able to obtain section_title. But cannot get subsection_val. I ve tried this with the proxy in store, but could not fix it. Can any one please help.

  • 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-08T00:26:52+00:00Added an answer on June 8, 2026 at 12:26 am

    I ran into similar issues with parsing nested XML elements. Unfortunately, after much hacking around in the XML Parsing code, I eventually gave up. (Ended up writing a passthrough to our web services that would transform the response in to JSON)

    You can read about my (mis)-adventures here:

    http://www.sencha.com/forum/showthread.php?189537-Sencha-Touch-2.0-nested-XML-parsing

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

Sidebar

Related Questions

I am trying to parse the following XML with javascript: <?xml version='1.0' encoding='UTF-8'?> <ResultSet>
I am trying to parse the following XML: <?xml version=1.0 encoding=UTF-8?> <!-- _tag -->
guys Following is the xml which i am trying to parse <?xml version=1.0 encoding=UTF-8?><Categories><category
I have the following xml file: <?xml version=1.0 encoding=UTF-8?> <users> <user id=0 firstname=John/> </users>
Hi Guys I am having following type of XML to parse. <?xml version=1.0 encoding=utf-8
I am trying to parse the following XML file in Java and to store
I have the following xml snippet: <?xml version=1.0 encoding=UTF-8 ?> <!DOCTYPE sqlMap PUBLIC -//ibatis.apache.org//DTD
I'm trying to parse the following XML with the following jQuery. Nothing is displayed
So I'm trying to parse the following XML document with C#, using System.XML: <root
I am trying to parse the following xml to punycode but it's not working

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.