PDA

View Full Version : loading xml data works in chrome and safari but fails in firefox



noefingway
14 Dec 2013, 4:06 PM
Maybe someone has seen this issue before, I'm stumped.

I'm using ExtJS 4.2.1.883

I've got a fairly complex application that I'm building as a front-end to a Sharepoint list. I've run into a problem where the xml data that's returned is correctly read and loaded by extjs when the browser is Chrome or Safari but not in Firefox or IE9. I traced through the code in Chrome and Firefox and can't see any difference in the way the data is handled.

If anyone has seen this issue and has a solution please let me know, and how to get around it.

I have simple test case:

demo.html

<html>

<head>
<link href="resources/css/ext-all-debug.css" rel="stylesheet" />
<script type="text/javascript" src="libraries/extjs/ext-debug.js"></script>
<script type="application/javascript" src="demo.js"></script>
</head>


<body>


<h1>EXTJS Example</h1>
<p id="demo">Here we try to load XML into an EXTJS XML Reader</p>
<div id='ctl00_MSO_ContentDiv' />
<button type="button" onclick="getResult();">getResult</button>


</body>


</html>

demo.js

var test;

function getResult() {
console.log("test:", test);
document.getElementById("demo").innerHTML =
"<p>First Record Id is: " + test.records[0].data.ID + "</p>" +
"<p> Title is: " + test.records[0].data.Title + "</p>" +
"<p> Plan Number is: " + test.records[0].data.ProjPlanNumber + "</p>" +
"<p> Category is: " + test.records[0].data.ProjCategory + "</p>" +
"<p> Start Date is: " + test.records[0].data.ProjStartDate + "</p>"


;
}


Ext.onReady(function () {
Ext.define('User', {
extend: 'Ext.data.Model',
autoload: true,






fields: [{
name: 'ID',
type: 'string',
mapping: '@ows_ID'
}, {
name: 'Title',
type: 'string',
mapping: '@ows_Title'
}, {
name: 'ProjPlanNumber',
type: 'string',
mapping: '@ows_ProjPlanNumber'
}, {
name: 'ProjCategory',
type: 'string',
mapping: '@ows_ProjCategory'
}, {
name: 'ProjStartDate',
type: 'date',
mapping: '@ows_ProjStartDate'
},
{
name: 'ProjPrincipalInvestigator',
type: 'string',
mapping: '@ows_ProjPrincipalInvestigator'
}
],


});


var store = Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url: 'soapListItems.xml',
reader: {
type: 'xml',
record: 'row',
root: 'Body',
totalRecords: 'listitems>data[ItemCount]',
idProperty: 'listitems>data[ows_ID]',
read: function (response) {
var data;
if (response && response.responseText) {
data = this.getResponseData(response);
}
console.log("response:", response);


console.log("data:", data);
if (data) {
return this.readRecords(data);
} else {
return this.nullResultSet;
}




}
}
}
});


store.load(function () {
var proxy = store.getProxy(),
reader = proxy.getReader(),
xmlData = reader.xmlData;
console.log("xmlData:", xmlData);
test = xmlData;
});




});

soapListItems.xml

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"><GetListItemsResult><listitems xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'><rs:data ItemCount="12"><z:row ows_ID='12' ows_Title='PP00012' ows_ProjCategory='Execution' ows_ProjPlanNumber='NB00012' ows_ProjStartDate='2013-08-01 00:00:00' ows_ProjEndDate='2013-12-30 00:00:00' ows_ProjPrincipalInvestigator='Snidley Whiplash' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Approved' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='12;#{B90CC048-A3E7-4ED8-9BCD-05AD755D5B19}' ows_owshiddenversion='1' ows_FSObjType='12;#0' ows_Created='2013-12-05 10:21:05' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:05' ows_FileRef='12;#APP/RS/Lists/Projects/12_.000' ows_MetaInfo='12;#' /><z:row ows_ID='11' ows_Title='PP00011' ows_ProjCategory='Planning' ows_ProjPlanNumber='NB00011' ows_ProjStartDate='2013-10-21 00:00:00' ows_ProjEndDate='2011-01-20 00:00:00' ows_ProjPrincipalInvestigator='Barney Rubble' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Submitted' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='11;#{81E0C782-07A2-43C4-B997-5534F8F72B52}' ows_owshiddenversion='1' ows_FSObjType='11;#0' ows_Created='2013-12-05 10:21:05' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:05' ows_FileRef='11;#APP/RS/Lists/Projects/11_.000' ows_MetaInfo='11;#' /><z:row ows_ID='10' ows_Title='PP00010' ows_ProjCategory='Initiation' ows_ProjPlanNumber='NB00010' ows_ProjStartDate='2013-11-11 00:00:00' ows_ProjEndDate='2013-12-01 00:00:00' ows_ProjPrincipalInvestigator='Fred Flinstone' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Edit' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='10;#{FB18FAF7-2433-459B-92C4-0004BBC420C7}' ows_owshiddenversion='1' ows_FSObjType='10;#0' ows_Created='2013-12-05 10:21:05' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:05' ows_FileRef='10;#APP/RS/Lists/Projects/10_.000' ows_MetaInfo='10;#' /><z:row ows_ID='9' ows_Title='PP00009' ows_ProjCategory='Execution' ows_ProjPlanNumber='NB00009' ows_ProjStartDate='2013-09-01 00:00:00' ows_ProjEndDate='2013-11-30 00:00:00' ows_ProjPrincipalInvestigator='Snidley Whiplash' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Approved' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='9;#{08946F0D-F557-4F08-84EF-AB326BCC0528}' ows_owshiddenversion='1' ows_FSObjType='9;#0' ows_Created='2013-12-05 10:21:05' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:05' ows_FileRef='9;#APP/RS/Lists/Projects/9_.000' ows_MetaInfo='9;#' /><z:row ows_ID='8' ows_Title='PP00008' ows_ProjCategory='Planning' ows_ProjPlanNumber='NB00008' ows_ProjStartDate='2013-09-01 00:00:00' ows_ProjEndDate='2013-11-30 00:00:00' ows_ProjPrincipalInvestigator='Barney Rubble' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Returned For Edit' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='8;#{826812B8-F83C-4061-A5AA-E0110AE9888C}' ows_owshiddenversion='1' ows_FSObjType='8;#0' ows_Created='2013-12-05 10:21:05' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:05' ows_FileRef='8;#APP/RS/Lists/Projects/8_.000' ows_MetaInfo='8;#' /><z:row ows_ID='7' ows_Title='PP00007' ows_ProjCategory='Initiation' ows_ProjPlanNumber='NB00007' ows_ProjStartDate='2013-09-01 00:00:00' ows_ProjEndDate='2013-11-30 00:00:00' ows_ProjPrincipalInvestigator='Fred Flinstone' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Withdrawn' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='7;#{2A0BF491-B740-4CB5-9523-CC7655408C2B}' ows_owshiddenversion='1' ows_FSObjType='7;#0' ows_Created='2013-12-05 10:21:05' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:05' ows_FileRef='7;#APP/RS/Lists/Projects/7_.000' ows_MetaInfo='7;#' /><z:row ows_ID='6' ows_Title='PP00006' ows_ProjCategory='Execution' ows_ProjPlanNumber='NB00006' ows_ProjStartDate='2013-08-01 00:00:00' ows_ProjEndDate='2013-12-30 00:00:00' ows_ProjPrincipalInvestigator='Snidley Whiplash' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Approved' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='6;#{197376CB-1F35-4794-B0BE-103F6B713B03}' ows_owshiddenversion='1' ows_FSObjType='6;#0' ows_Created='2013-12-05 10:21:05' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:05' ows_FileRef='6;#APP/RS/Lists/Projects/6_.000' ows_MetaInfo='6;#' /><z:row ows_ID='5' ows_Title='PP00005' ows_ProjCategory='Planning' ows_ProjPlanNumber='NB00005' ows_ProjStartDate='2013-09-21 00:00:00' ows_ProjEndDate='2013-11-20 00:00:00' ows_ProjPrincipalInvestigator='Barney Rubble' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Returned For Review' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='5;#{A453A926-7E4F-45E2-B168-AC1736C4D557}' ows_owshiddenversion='1' ows_FSObjType='5;#0' ows_Created='2013-12-05 10:21:04' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:04' ows_FileRef='5;#APP/RS/Lists/Projects/5_.000' ows_MetaInfo='5;#' /><z:row ows_ID='4' ows_Title='PP00004' ows_ProjCategory='Initiation' ows_ProjPlanNumber='NB00004' ows_ProjStartDate='2013-09-11 00:00:00' ows_ProjEndDate='2013-11-15 00:00:00' ows_ProjPrincipalInvestigator='Fred Flinstone' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Edit' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='4;#{FEAF8F87-24CB-47AE-B378-858D7CB4BF33}' ows_owshiddenversion='1' ows_FSObjType='4;#0' ows_Created='2013-12-05 10:21:04' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:04' ows_FileRef='4;#APP/RS/Lists/Projects/4_.000' ows_MetaInfo='4;#' /><z:row ows_ID='3' ows_Title='PP00003' ows_ProjCategory='Execution' ows_ProjPlanNumber='NB00003' ows_ProjStartDate='2013-08-01 00:00:00' ows_ProjEndDate='2013-11-30 00:00:00' ows_ProjPrincipalInvestigator='Snidley Whiplash' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus=' Approved' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='3;#{EB2F1EAE-79C6-4473-9944-C1040211FFFB}' ows_owshiddenversion='1' ows_FSObjType='3;#0' ows_Created='2013-12-05 10:21:04' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:04' ows_FileRef='3;#APP/RS/Lists/Projects/3_.000' ows_MetaInfo='3;#' /><z:row ows_ID='2' ows_Title='PP00002' ows_ProjCategory='Planning' ows_ProjPlanNumber='NB00002' ows_ProjStartDate='2013-09-01 00:00:00' ows_ProjEndDate='2013-11-30 00:00:00' ows_ProjPrincipalInvestigator='Barney Rubble' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Submitted' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='2;#{D77C3384-F815-40C8-B73C-C8FD979135CC}' ows_owshiddenversion='1' ows_FSObjType='2;#0' ows_Created='2013-12-05 10:21:04' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:04' ows_FileRef='2;#APP/RS/Lists/Projects/2_.000' ows_MetaInfo='2;#' /><z:row ows_ID='1' ows_Title='PP00001' ows_ProjCategory='Initiation' ows_ProjPlanNumber='NB00001' ows_ProjStartDate='2013-09-01 00:00:00' ows_ProjEndDate='2013-11-30 00:00:00' ows_ProjPrincipalInvestigator='Fred Flinstone' ows_ProjBSLSuite=';#BSL 4;#' ows_ProjStatus='Edit' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='1;#{26F7A431-6DDF-4D7B-A466-CD72A4A33D5A}' ows_owshiddenversion='1' ows_FSObjType='1;#0' ows_Created='2013-12-05 10:21:04' ows_PermMask='0x7fffffffffffffff' ows_Modified='2013-12-05 10:21:04' ows_FileRef='1;#APP/RS/Lists/Projects/1_.000' ows_MetaInfo='1;#' /></rs:data></listitems></GetListItemsResult></GetListItemsResponse></soap:Body></soap:Envelope>

Kevin Jackson
17 Dec 2013, 9:10 AM
I did find several threads on XML parsing issues. They have a few ideas on addressing them here https://support.mozilla.org/en-US/questions/973340