• 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: NSXMLParser & whitespace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLParser & whitespace


  • Subject: Re: NSXMLParser & whitespace
  • From: Ken Tozier <email@hidden>
  • Date: Mon, 26 Jul 2004 22:12:26 -0400

On Jul 26, 2004, at 8:58 PM, Kevin Ballard wrote:

I think a better question is why are you writing a custom parser for
plist files?

This was probably just a rhetorical question, but FYI...

I'm saving complex AppleEvents for use with QuarkXPress in plist format rather AEGizmo strings (because it's easier to see the structure and edit them that way) and after messing around awhile trying to write a plist to AppleEvent coercion using normal NSDictionary and NSArray calls, it just seemed easier to do the coercion at read time. Requires a lot less overhead than coercing after the fact.

A custom parser also allows me to merge in substitutions for deeply nested fields at read time (because it's just a string at that point) rather than having to go back and walk through the entire tree searching for fields to replace.


On Jul 26, 2004, at 11:31 AM, Ken Tozier wrote:

I'm writing a custom parser for plist files using NSXMLParser and have
everything working OK except for the "pretty" whitespace Property List
Editor inserts for readability. All my found strings end with returns
followed by a variable number of tabs. I've tried using "parser:
foundIgnorableWhitespace:" and releasing the whitespace string like so:

- (void) parser:(NSXMLParser *) parser
foundIgnorableWhitespace:(NSString *) whitespaceString
{
[whitespaceString release];
}

but the found strings still have the whitespace suffix.

Anyone know how to ignore whitespace in found strings?

--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: How to change background color of NSDrawer?
  • Next by Date: Re: Stopping on objc exceptions in Xcode
  • Previous by thread: Re: NSXMLParser & whitespace
  • Next by thread: NSColor
  • Index(es):
    • Date
    • Thread