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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:29:46+00:00 2026-05-26T23:29:46+00:00

Appcelerator Q&A Link: XML Parsing failure on Android but works on iPhone I am

  • 0

Appcelerator Q&A Link:
XML Parsing failure on Android but works on iPhone

I am preparing a general application which works both for iPhone and Android phones with same code for which Titanium is majorly used for. With the same code I found different results for XML document parsing and my android app does not load it properly. It causes NULLPointer Exception. But the same code works perfectly on iPhone.

Can you check this?

xyz(languageCode, currentVersion, xmldoc) {
try {
  Ti.API.info('Start parsing the library');
  var archiveData = xmldoc.getElementsByTagName('archive');
  Ti.API.info('Archive: ' + archiveData);
  Ti.API.info('Item: ' + archiveData.item);
  Ti.API.info('Lendth: ' + archiveData.length);
  var newVersion = archiveData.item(0).getAttribute('version');
}catch(e){
  Ti.API.info('Library Went In Catch: ' + e);
}

Function call: It’s from onload() method of Ti.Network.HttpClient

xyz(languageCode, version,this.responseXML.documentElement);

Output of iPhone:

Archive: [object TiDOMNodeList]

[INFO] Item: [object TiDOMNodeList]

[INFO] Lendth: 1

Output of Android:

[INFO] [3,7225] Archive: [Ti.NodeList]

[INFO] [1,7226] Item: [KrollMethod item]

[INFO] [2,7228] Lendth: 0 [INFO]

[235,7466] Library Went In Catch: JavaException: java.lang.NullPointerException: null

  • 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-05-26T23:29:46+00:00Added an answer on May 26, 2026 at 11:29 pm

    Check the link:

    http://developer.appcelerator.com/question/128341/xml-parsing-failure-on-android-but-works-on-iphone#comment-104281

    For parsing XML using:

    var xml = Ti.XML.parseString(this.responseXML.toString());
    
    xyz(languageCode, version, xml);
    

    “this.responseXML.documentElement”. It has some problems on Android (don’t know is it reported or not). The workaround it to use “Ti.XML.parseString” method to re-parse XML:.

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

Sidebar

Related Questions

I have recently started creating an iPhone application using Appcelerator's Titanium. Since the application
I'm building a calander app for Android in appcelerator, but now I'm having some
Im building a mobile app for android & ios using appcelerator. I've build a
I've setup some webviews & with tabs in Appcelerator Titanium, but wondered: How can
I am using Titanium appcelerator for developing my android application, more over i am
I am trying to use appcelerator to develop some cross platform mobile applications, but
I am learning how to build mobile JavaScript Application in Titanium Appcelerator. I am
I'm trying to use a framework called appcelerator titanium to make a simple iphone
I am developing an application in Javascript using Appcelerator and I need to compare
I followed the guide here: http://developer.appcelerator.com/guides/en/app_structure.html to use high & medium density images for

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.