Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16453] iOS: Build failed while parsing html

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-05-08T05:25:47.000+0000
Affected Version/sRelease 3.2.0, Release 3.2.1
Fix Version/s2014 Sprint 07, 2014 Sprint 07 Tooling, Release 3.3.0
ComponentsiOS
Labelsmodule_webview, qe-closed-3.3.0, qe-testadded, triage
ReporterMostafizur Rahman
AssigneeChris Barber
Created2014-02-12T06:29:37.000+0000
Updated2014-07-29T17:16:47.000+0000

Description

Problem

WebView throw an error in Ti apps for local html file.

Testing Environments

Mac OS X 10.8.5 Titanium SDK: 3.2.1.GA Titanium CLI: 3.2.1 IOS Simulator 7.0.3 Appcelerator Studio, build: 3.2.1.201402061120

Test Code

var win = Ti.UI.createWindow({
	layout : 'vertical',
	backgroundColor : "#fff"

});

// Create a WebView
var aWebView = Ti.UI.createWebView({
	url : '/1357256.html' //http://appc.mrtechnologybd.com/1357256.html
});
aWebView.addEventListener('load', function(e) {
	Ti.API.info('webview loaded: ' + e.url);
});

// Add to the parent view.
win.add(aWebView);

win.open();

Steps to reproduce

Create New Ti Sample project

Save attached html file to resource folder

Update app.js file with test code

Run test code in IOS Simulator

Check console log for error message

Error Logs

/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/xmldom/sax.js:102
			var localNSMap = config.localNSMap;
			                       ^
TypeError: Cannot read property 'localNSMap' of undefined
    at parse (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/xmldom/sax.js:102:27)
    at XMLReader.parse (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/xmldom/sax.js:30:3)
    at DOMParser.parseFromString (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/xmldom/dom-parser.js:25:7)
    at Object.analyzeHtml (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/titanium-sdk/lib/jsanalyze.js:159:58)
    at Object.analyzeHtmlFile (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/titanium-sdk/lib/jsanalyze.js:146:17)
    at /Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/iphone/cli/commands/_build.js:2726:17
    at async.whilst (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/async/lib/async.js:619:13)
    at recursivelyCopy (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/iphone/cli/commands/_build.js:2675:9)
    at /Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/iphone/cli/commands/_build.js:2697:39
    at async.whilst (/Users/mrahman/Library/Application Support/Titanium/mobilesdk/osx/3.2.1.GA/node_modules/async/lib/async.js:619:13)
Thanks

Attachments

FileDateSize
1357256.html2014-02-12T06:29:37.000+000026983
hello.html2014-02-12T19:34:04.000+0000179

Comments

  1. Chris Barber 2014-04-01

    The attached 1357256.html file is extremely malformed. It contains multiple tags which is a huge no-no. Regardless, I've got a fix for when the html is so badly malformed.
  2. Chris Barber 2014-04-01

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5566
  3. Deepti Pandey 2014-05-08

    Verified as FIXED using : Mac :10.9.2 Appcelerator Studio, build: 3.3.0.201405011408 SDK - 3.3.0.v20140507163312 acs-1.0.14 alloy-1.4.0-dev npm-1.3.2 titanium-3.3.0-dev titanium-code-processor-1.1.1 Xcode :5.1.1 Devices used: iPhone 5s (7.1.1) , iPhone Simulator 7.1 Jsananalyzer is able to parse malformed html files. I am successfully able to run with given code and no console logs are seen with classic.html file.Hence closing as fixed.
  4. Deepti Pandey 2014-05-08

    reopening to add device details.

JSON Source