Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Regular Contributor
Posts: 83
Registered: ‎07-19-2012
My Device: Bold 9790, Dev Alpha A
My Carrier: Koodo
Accepted Solution

HTTP Communication Tutorial - Error Parsing XML File

Hello again,

I went through the HTTP Communication tutorial today located here. Built everything fine and it loaded in the simulator, however when I hit refresh to load the xml data from an HTTP network call I got the error:

 

XmlDataModel: Error parsing file ../../../data/model.xml on line 14, column 8: "unexpected character"

 

Considering the character location of line 14, column 8 is after the end of the XML File this really confused me.

 

Any thoughts on how to work around this?

 

The  XML file can be found at https://developer.blackberry.com/cascades/files/documentation/device_platform/networking/model.xml

 

 

 

Developer
Posts: 610
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: HTTP Communication Tutorial - Error Parsing XML File

bump getting same error

Highlighted
New Developer
Posts: 8
Registered: ‎07-19-2012
My Device: Z10 LE
My Carrier: T-Mobile

Re: HTTP Communication Tutorial - Error Parsing XML File

Developer
Posts: 610
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: HTTP Communication Tutorial - Error Parsing XML File

That worked! Thank you.

Regular Contributor
Posts: 83
Registered: ‎07-19-2012
My Device: Bold 9790, Dev Alpha A
My Carrier: Koodo

Re: HTTP Communication Tutorial - Error Parsing XML File

Seems to work fine now which is awesome! However the URL's look identical to me so I have no idea whats changed since yesterday haha oh well Smiley Happy

Developer
Posts: 610
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: HTTP Communication Tutorial - Error Parsing XML File

I believe the issue is that the QURL string was being put onto two lines forcing a \/ escape that was throwing the error. The url is the same.

New Developer
Posts: 41
Registered: ‎07-12-2012
My Device: Orlando, Dev Alpha
My Carrier: Telkomsel

Re: HTTP Communication Tutorial - Error Parsing XML File

Wow its great Smiley Happy

 

but how if we use xmldata from rss feed ? i see that model.xml has a different format with rss feed ?

 

is there any reference to parse and convert rss feed to model.xml kind of format.

 

regards

 

 

Developer
Posts: 610
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: HTTP Communication Tutorial - Error Parsing XML File

I think the magic occurs in QNetworkReply. Once you get data, you specify a data model I agree: would be wonderful to get into parsing different types of xml models.

Bump again
Developer
Posts: 610
Registered: ‎10-17-2010
My Device: (BlackBerry Z10)-> Q10/Passport Dual Use

Re: HTTP Communication Tutorial - Error Parsing XML File

Bump for tutorial on parsing different json data models too.
New Developer
Posts: 41
Registered: ‎07-12-2012
My Device: Orlando, Dev Alpha
My Carrier: Telkomsel

Re: HTTP Communication Tutorial - Error Parsing XML File

double bump