-
13 Jan 2011 11:46 PM #61
Ok sorry as i am a newbie, i though ExtJS can be used in Sencha to read XML ? because i can read the xml without Nested using Sencha please check below this code works.. and the problem i am facing
Following is the JS
that readsCode:Ext.regModel('HitrateRegel',{ fields:[ {name:'title',type: 'string'}, {name:'description',type: 'string'} ] }); var HitrateStore = new Ext.data.Store({ model: 'HitrateRegel', proxy: { type: 'ajax', url: 'data.xml', reader: { type: 'xml', record:'category' } }, listeners: { load: function(store, records, success) { console.log(store); console.log(records); console.log(success); } } }); testtpl = '<div class="contact"><table><tr><td><strong>{title}</strong><br>{description}</td></tr></table></div>'; topics = new Ext.List({ tpl:'<tpl for=".">'+ testtpl +'</tpl>', xtype: 'list', cls: 'demo-list', itemSelector: 'div.contact', iconCls: 'topicIcon', title:'Topics', store: HitrateStore, listeners: { beforeactivate: function(c) { HitrateStore.load(); } } });
This XML
But Problem is to read /modify the code to read following :Code:<?xml version="1.0" encoding="ISO8859-1" ?> <categories> <category> <title id="1">Category one</title> <description>description Category onedescription Category onedescription Category onedescription Category onedescription Category one</description> </category> <category> <title>Category two</title> <description>description Category one description Category one description Category one description Category one description Category one</description> </category> <category> <title>Category three</title> <description>description Category one description Category one description Category one description Category one description Category one</description> </category> <category> <title>Category four</title> <description>description Category one description Category one description Category one description Category one description Category one</description> </category> <category> <title>Category five</title> <description>description Category one description Category one description Category one description Category one description Category one</description> </category> <category> <title>Category six</title> <description>description Category one description Category one description Category one description Category one description Category one</description> </category> <category> <title>Category seven</title> <description>description Category one description Category one description Category one description Category one description Category one</description> </category> </categories>
Please helpCode:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:categories> <category catId="96" title="News"/> <category catId="97" title="Articles"> <category catId="101" title="Destinations"/> <category catId="102" title="Epics"/> <category catId="103" title="People"/> <category catId="104" title="Gear"> <category catId="105" title="Accessories"/> <category catId="106" title="Belay Devices"/> <category catId="107" title="Bouldering Gear"/> <category catId="108" title="Carabiners/Draws"/> <category catId="109" title="Harnesses"/> <category catId="110" title="Headlamps"/> <category catId="111" title="Helmets"/> <category catId="112" title="Ice Climbing Gear"/> <category catId="113" title=""Nuts, Cams & Other Pro""/> <category catId="114" title="Ropes"/> <category catId="115" title="Shoes"/> <category catId="116" title="Soft Goods"/> <category catId="98" title="Videos"/> <category catId="99" title="Blog"/> <category catId="100" title="Photos"/> </ns2:categories>
-
14 Jan 2011 1:21 AM #62
-
14 Jan 2011 1:31 AM #63Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
I don't know enough of the new Sencha Touch data model. You really need to ask this in the Sencha Touch forum section.
-
23 Mar 2011 5:51 AM #64
Issues with ExtJs xml parsing
Issues with ExtJs xml parsing
I have below xml, how i can parse it using ext js :
<MenubarUAT>
<parentMenu entitlementChunkName="" MenuName="Documents" MenuId="1" isParent="Y">
<Menu entitlementChunkName="documentumAccess" MenuName="Search" MenuId="9" isParent="N" MenuLevel="2" Url="javascript:addBCLNavigation('/DocumentSearch'
"></Menu>
<Menu entitlementChunkName="documentumAccess" MenuName="Recent Documents" MenuId="10" isParent="N" MenuLevel="2" Url="javascript:addBCLNavigation('/IDM/MyDocumentsResults'
"></Menu>
<Menu entitlementChunkName="cgpliance" MenuName="Rpt Params" MenuId="13" isParent="N" MenuLevel="2" Url="javascript:addBCLNavigation('/IDM/ComplianceReportParams'
"></Menu>
<Menu entitlementChunkName="documentumAccess" MenuName="Save New Document" MenuId="12" isParent="N" MenuLevel="2" Url="javascript:openPopup('/DocumentImport','','',920,730,0,0);"></Menu>
<Menu entitlementChunkName="documentumAccess" MenuName="Documents in Progress" MenuId="11" isParent="N" MenuLevel="2" Url="javascript:addBCLNavigation('/LocalDocumentsResults'
"></Menu>
</parentMenu>
</MenubarUAT>
-
19 Sep 2011 3:57 AM #65
Chart xml parsing-Need help
Chart xml parsing-Need help
Hi,
Due to blocking of cross domain xml file from different webserver, I need to parse the chart xml using xmlReader and then again get back this raw xml file and pass it back to chart component for displaying as it takes xml file.<br><br> I am trying to parse this chart xml.
I am not able to parse this xml... not sure how to do this...Code:<?xml version="1.0"?> <chart caption='Company Revenue' canvasBorderColor="999999" plotSpacePercent="50" plotBorderColor="666666" useRoundEdges="1" showPlotBorder="1" plotBorderDashed="1" showVLineLabelBorder="1" showBorder="0" canvasBorderThickness="1" animation="1" numDivLines="2" bgAlpha="50" showValues="0" bgColor="FFFFFF" logoURL="../images/common/little_logo.gif" logoPosition="BR"> <categories> <category label='Jan' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Feb' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Mar' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Apr' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='May' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Jun' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Jul' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Aug' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Sep' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Oct' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Nov' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> <category label='Dec' showName="1"/> <vLine color="666666" dashed="1" dashLen="0.5"/> </categories> <dataset seriesName='Product A' color="255B89"> <set value='27400' /> <set value='29800'/> <set value='25800' /> <set value='26800' /> <set value='29600' /> <set value='32600' /> <set value='31800' /> <set value='36700' /> <set value='29700' /> <set value='31900' /> <set value='34800' /> <set value='24800' /> </dataset> <dataset seriesName='Product B' color="9D0E2D"> <set value='10000'/> <set value='11500'/> <set value='12500'/> <set value='15000'/> <set value='11000' /> <set value='9800' /> <set value='11800' /> <set value='19700' /> <set value='21700' /> <set value='21900' /> <set value='22900' /> <set value='20800' /> </dataset> <styles> <definition> <style name="myLabelsFont" type="font" font="Arial" size="11"/> <style name="myShadow" type="Shadow" color="666666" angle="45"/> </definition> <application> <apply toObject='DataLabels' styles='myLabelsFont, myShadow' /> </application> </styles> </chart>
Appreciate if someone can guide me.
Thanks & Regards,
Ajay
-
10 Oct 2011 12:39 AM #66
ExtJS + xml
ExtJS + xml
I have xml from rest service(url: http://localhost:1008/srv/adres/test/1):
<XMLDataResponse xmlns="http://tempuri.org/">
<XMLDataResult>enter 1</XMLDataResult>
</XMLDataResponse>
how I can read "enter 1" from this xml and show in window?
I use
var store = new Ext.data.Store({
url:'http://localhost:1008/srv/adres/test/1.xml',
autoLoad:true,
reader: new Ext.data.XmlReader({
record:'XMLDataResponse',
id: 'XMLDataResponse'
}, [
'XMLDataResponse'
])
});
store.load();
but it doesn't work
-
7 Nov 2011 11:39 PM #67
I want to parse a simple XML file as given in sample.
I want to parse a simple XML file as given in sample.
Here is the simple XML file that I have to parse<br>:<br><br>
And this is how I am doing it: in WOList.js<?xml version="1.0" encoding="UTF-8"?>
<users>
<user>
<id>1</id>
<name>Ed Spencer</name>
<email>ed@sencha.com</email>
</user>
<user>
<id>2</id>
<name>Abe Elias</name>
<email>abe@sencha.com</email>
</user>
<user>
<id>3</id>
<name>Gaurav Keshre</name>
<email>gaurav.keshre@hysistchnologies.com</email>
</user>
</users>
userXMLModel = Ext.regModel('Users',{
fields: ['id', 'name', 'email']
});
var userXMLstore = new Ext.data.Store({
model: 'Users',
proxy: {
type: 'ajax',
url : 'sample.xml',
reader: {
type : 'xml',
root : 'users',
record: 'user',
}
}
});
///rendering the store on page:
alsUSA.views.WOList = new Ext.List({
id: 'WOList',
store: userXMLstore,
layout : 'fit',
itemTpl: '<div class="list-item-title">{id}</div>' +
'<div class="list-item-narrative">{name}</div>'+
'<div class="list-item-narrative">{email}</div>',
indexBar:false,
singleSelect : 'true',
});
My problem is I am not getting anything in the list.
THis is the first time using Sencha touch.
please guide
-
8 Nov 2011 5:51 AM #68
Getting more specific on my problem
Getting more specific on my problem
There is an XML response that I have to parse and get JSON.
How should I approach to get the "Logged In" value so that I can confirm login success/ failure.Code:<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://myurl.mydomain.com/MobileWebService/">{"LoggedIn":true,"Status":true,"Message":"Logged In.","Id":"8df8gvh-fv8fv8hfu-f8rvrujnjk"}</string>
This is just first step .
I tried many examples for parsing and rendering data from simple xml but never succeeded.
Please guide
Thanks in Advance!
-
20 Apr 2012 1:57 AM #69
XML parsing with Ext js
XML parsing with Ext js
Hi Condor,
Maybe you can also shine some light on my project.
I need the parse this XML which is the output of a website
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>Sentry Syndication Feed</title>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<description>
Sentry Event Items Aggregated into Syndication Feed
</description>
<generator>Sentry 1.0</generator>
<image>
<url>
https://ardentlabs.ardentmc.net/test...SentryLogo.png
</url>
<title>Sentry Syndication Feed</title>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
</image>
<item>
<guid isPermaLink="false">24611c03-307d-44a9-b78f-abced37fa9bf</guid>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<author>jim.correll@ardentmc.com</author>
<category domain="EventScheme">Mississippi Flooding</category>
<title>Mississippi Flooding</title>
<description>
Extensive flooding ocurring in Minneapolis-St. Paul, MN
</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="https://ardentlabs.ardentmc.net/Sentry/GeoRSS/"/>
<a10:updated>2012-04-20T04:33:53-04:00</a10:updated>
<a10:rights type="text">Copyright 2012</a10:rights>
<a10:content type="text">
Extensive flooding ocurring in Minneapolis-St. Paul, MN
</a10:content>
<point xmlns="http://www.georss.org/georss">44.899 -93.149</point>
<image>
https://ardentlabs.ardentmc.net/test...ster_flood.png
</image>
</item>
<item>
<guid isPermaLink="false">814b27b7-738f-411c-8029-33ea9c690931</guid>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<author>jim.correll@ardentmc.com</author>
<category domain="EventScheme">Mississippi Flooding</category>
<title>Jim Correll</title>
<description>More sandbags needed on west side of the river.</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="https://ardentlabs.ardentmc.net/Sentry/GeoRSS/"/>
<a10:updated>2012-04-20T04:33:53-04:00</a10:updated>
<a10:rights type="text">Copyright 2012</a10:rights>
<a10:content type="text">More sandbags needed on west side of the river.</a10:content>
<point xmlns="http://www.georss.org/georss">44.9372 -93.0492</point>
<image>
https://ardentlabs.ardentmc.net/test...oPhotoIcon.png
</image>
</item>
<item>
<guid isPermaLink="false">c892469c-93b5-461c-ad7f-99f0c9d5d744</guid>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<author>brandon.labonte@ardentmc.com</author>
<category domain="EventScheme">Mississippi Flooding</category>
<title>Brandon LaBonte</title>
<description>Levee breached at airport</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="https://ardentlabs.ardentmc.net/Sentry/GeoRSS/"/>
<a10:updated>2012-04-20T04:33:53-04:00</a10:updated>
<a10:rights type="text">Copyright 2012</a10:rights>
<a10:content type="text">Levee breached at airport</a10:content>
<point xmlns="http://www.georss.org/georss">44.9440 -93.0659</point>
<image>
https://ardentlabs.ardentmc.net/test...oPhotoIcon.png
</image>
</item>
<item>
<guid isPermaLink="false">46bc7b66-b141-4caf-999a-ab27b26ff0f9</guid>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<author>fema@fema.dhs.gov</author>
<category domain="EventScheme">Mississippi Flooding</category>
<title>FEMA</title>
<description>Governor declares State of Emergency in Minnesota</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="https://ardentlabs.ardentmc.net/Sentry/GeoRSS/"/>
<a10:updated>2012-04-20T04:33:53-04:00</a10:updated>
<a10:rights type="text">Copyright 2012</a10:rights>
<a10:content type="text">Governor declares State of Emergency in Minnesota</a10:content>
<point xmlns="http://www.georss.org/georss">44.9184 -93.1371</point>
<image>
https://ardentlabs.ardentmc.net/test...oPhotoIcon.png
</image>
</item>
<item>
<guid isPermaLink="false">0441a97a-6ff6-4500-b887-4ac2117ba7dd</guid>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<author>jim.correll@ardentmc.com</author>
<category domain="EventScheme">Northeast Blizzards</category>
<title>Northeast Blizzards</title>
<description>
Snow and ice pounding New England, resulting in power outages across four states
</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="https://ardentlabs.ardentmc.net/Sentry/GeoRSS/"/>
<a10:updated>2012-04-20T04:33:53-04:00</a10:updated>
<a10:rights type="text">Copyright 2012</a10:rights>
<a10:content type="text">
Snow and ice pounding New England, resulting in power outages across four states
</a10:content>
<point xmlns="http://www.georss.org/georss">43.06 -71.74</point>
<image>
https://ardentlabs.ardentmc.net/test...ster_flood.png
</image>
</item>
<item>
<guid isPermaLink="false">b488fd84-ae9f-4b78-8322-4cef7f5d8231</guid>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<author>jim.correll@ardentmc.com</author>
<category domain="EventScheme">Airplane Crash</category>
<title>Airplane Crash</title>
<description>
According to Open Source reports, an small airplane has crashed into Coast Guard facilities in the Washington, DC metro area
</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="https://ardentlabs.ardentmc.net/Sentry/GeoRSS/"/>
<a10:updated>2012-04-20T04:33:53-04:00</a10:updated>
<a10:rights type="text">Copyright 2012</a10:rights>
<a10:content type="text">
According to Open Source reports, an small airplane has crashed into Coast Guard facilities in the Washington, DC metro area
</a10:content>
<point xmlns="http://www.georss.org/georss">38.8733 -77.0027</point>
<image>
https://ardentlabs.ardentmc.net/test...ster_flood.png
</image>
</item>
<item>
<guid isPermaLink="false">5cd41415-5c60-4cbd-a6f3-05330b368a41</guid>
<link>https://ardentlabs.ardentmc.net/Sentry/GeoRSS/</link>
<author>jim.correll@ardentmc.com</author>
<category domain="EventScheme">High Surf Advisory</category>
<title>High Surf Advisory</title>
<description>
The National Weather Service in Honolulu has continued the High Surf ADVISORY for Maui’s east-facing shores. The advisory will remain in effect until 6 a.m. on Wednesday, April 11
</description>
<a10:link rel="alternate" type="text/html" title="Alternate Link" length="1000" href="https://ardentlabs.ardentmc.net/Sentry/GeoRSS/"/>
<a10:updated>2012-04-20T04:33:53-04:00</a10:updated>
<a10:rights type="text">Copyright 2012</a10:rights>
<a10:content type="text">
The National Weather Service in Honolulu has continued the High Surf ADVISORY for Maui’s east-facing shores. The advisory will remain in effect until 6 a.m. on Wednesday, April 11
</a10:content>
<point xmlns="http://www.georss.org/georss">20.941 -156.364</point>
<image>
https://ardentlabs.ardentmc.net/test...ster_flood.png
</image>
</item>
</channel>
</rss>
Note : I need to read same category at home page
-
21 Aug 2012 3:50 AM #70
Hi sir,
I want to display a XML element value into the column name of the grid panel . Please can you provide me a answer to resolve my problem...



Reply With Quote