Re: NSXLMDocument and malformed XML
Re: NSXLMDocument and malformed XML
- Subject: Re: NSXLMDocument and malformed XML
- From: Todd Blanchard <email@hidden>
- Date: Fri, 26 May 2006 16:36:10 -0700
You might try this:
http://homepage.mac.com/tblanchard/ObjectiveExpat/
It doesn't validate - just generally works. Use the TBXmlPListParser
and you'll get back a plist data structure you can take apart using
valueForKeyPath:
On May 25, 2006, at 5:22 AM, Chris Gregg wrote:
Disclaimer: I'm still a newbie with Cocoa, and I'm slowly stumbling
onto new ways to do things more simply.
I wrote a little program that reads iWeb index.xml files (after
unzipping them in their original index.xml.gz), and I originally wrote
a minimalistic XML parser to get at the important bits of code I was
looking for, from the NSString I loaded from the file.
But then I stumbled onto XMLDocument, which, I thought, would make
my life much easier by loading the XML for me. Excellent. The
problem is that the XML in some iWeb index.xml files is malformed, and
I'm getting the following error back from initWithContentsOfURL:
options: error:
"Line 2: Namespace prefix xsi for type on color is not defined"
It would be nice if initWithContentsOfURL at least loaded in what it
could and then I could ignore the malformed parts, but I guess that's
not the way it works, as it just returns nil and the error.
Am I back to square one, where I need to just beef up my own XML
parser to take care of this, or can I gracefully recover from the
error and load it anyway?
Thanks!
-Chris Gregg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden