Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-27-2011, 11:15 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 3
Sinner6 is on a distinguished road
Default malformed XML error handling

My app has a way for users to import xml data. This means I have to do a really good job of dealing with malformed xml, but I haven't really used xml much in the past.

Right now I have having a problem where I can't figure own what went wrong.
I used xmlGetLastError() and it only ever says "Premature end of data in tag root line 2" even though the problem isn't missing </root>
the error case might look like:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<categorylist>
<category>Group1</category>
</root>

I am using xmlParseMemory if it makes any difference.

How do get more errors out of the parser? and do something useful with them?
Sinner6 is offline   Reply With Quote
Old 08-28-2011, 03:27 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

if a xml contain some problem, why you want to "fix" it? just return an error informing user to use a right xml file.....
__________________
dany_dev is offline   Reply With Quote
Old 08-28-2011, 08:14 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 3
Sinner6 is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
if a xml contain some problem, why you want to "fix" it? just return an error informing user to use a right xml file.....
"Fixing" it for the user would be awesome but I don't really intend to go that far.
The issue is a user might take one of my baseline XMLs modify and try to use it. Allowing for this is a really key feature for my app. What I want to do is display an error message then a textview with in the area of the error, allowing the user to fix it themselves.

See on this page the picture on the right. The error message points pretty close to the error. I am stumped on how to do that.
XML parsing error - MozillaZine Knowledge Base
Sinner6 is offline   Reply With Quote
Reply

Bookmarks

Tags
xml parsing error

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 397
13 members and 384 guests
7twenty7, chiataytuday, cristofercolmbos, fiftysixty, gmarro, iOS.Lover, kilobytedump, Matrix23, raymng, ryantcb, stanny, UMAD, xerohuang
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0