• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSXMLParserErrorDomain 4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLParserErrorDomain 4


  • Subject: Re: NSXMLParserErrorDomain 4
  • From: Brett Powley <email@hidden>
  • Date: Fri, 24 Feb 2006 14:28:55 +1100

A few other things to check:

* Is your file *really* in UTF-8? Try opening it in TextWrangler to check

If this is al lthat's in your file:
<?xml version="1.0" encoding="UTF-8"?>
<article author="Steven">
	<para> this is a short paragraph</para>
</article>

that doesn't look like it ought to be 443 bytes long

* Does it have Byte Order Markers (BOM)? I don't know whether NSXMLParser wants those or not. Again, you could use TextWrangler to check and save it without if it does

* Will another XML viewer open it? Try FireFox and see what it thinks of it.




On 24/02/2006, at 1:41 PM, Steven LeMaire wrote:

Please note, I also tried the following

NSXMLParser *myParser = [[NSXMLParser alloc] initWithData:data];

After adding the code suggested by Brett below, and still get the same error.
Using the same *data loaded with the xml, I am able to properly write out a new file.
So, I believe the xml is being read in fine.


Must all of the delegate methods be implemented for the parser to function correctly ?

On 23-Feb-06, at 8:11 PM, Steven LeMaire wrote:



Ok, sorry if this came through twice..

I added the line, and the *data shows a value of 443 bytes, after running the line,
in the debugger.


Also, xmlURL shows a value of file://localhost/parsetest.xml
after executing NSURL *xmlURL = [NSURL fileURLWithPath:filePath];

Any known issues like this on an Intel iMac ?


Hi Steven,

Have you tested whether the contents of your file really are being
read?  You could try something like:

    NSData *data = [xmlURL resourceDataUsingCache:NO];

to see if it does like your URL.

Cheers,
Brett




On 23/02/2006, at 1:34 PM, Chris Parker wrote:


On Feb 22, 2006, at 6:23 PM, Steven LeMaire wrote:

I am getting this error trying to parse a simple xml doc.
Can someone provide more info, with what is going wrong ?

The xml file is local on my HD, it is very simple. The code is
very simple.



-------------------------------------------------------------- Brett Powley -- PhD Candidate Centre for Language Technology, Macquarie University, Australia w: http://www.ics.mq.edu.au/~bpowley faciendi plures libros nullus est finis frequensque meditatio carnis adflictio est --------------------------------------------------------------



_______________________________________________
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


  • Follow-Ups:
    • Re: NSXMLParserErrorDomain 4
      • From: Steven LeMaire <email@hidden>
References: 
 >Re: NSXMLParserErrorDomain 4 (From: Steven LeMaire <email@hidden>)
 >Re: NSXMLParserErrorDomain 4 (From: Steven LeMaire <email@hidden>)

  • Prev by Date: Re: Design question: undo-safe "Processing..." sheets
  • Next by Date: Re: Growl Support?
  • Previous by thread: Re: NSXMLParserErrorDomain 4
  • Next by thread: Re: NSXMLParserErrorDomain 4
  • Index(es):
    • Date
    • Thread