Say I have an invalid XML. For some reason, TouchXML still sees it as a valid object.
For example:
NSString *str = @"?> obviously invalid!";
NSData *data = [str dataUsingEncoding:NSASCIIStringEncoding];
NSError *parseError = nil;
CXMLDocument *document = [[[CXMLDocument alloc] initWithData:data encoding:NSASCIIStringEncoding options:0 error:&parseError] autorelease];
NSLog(@"Error %i......%@", [parseError code], [parseError localizedFailureReason]);
NSLog(@"Document ......%@", [document description]);
The output is:
Error 0......(null)
Document ......<CXMLDocument 0x6f05710 [0x6f274c0]> <?xml version="1.0" encoding="us-ascii"?>
Does anybody know why this is happening? I'm not tidying up the XML...
Thanks!