NAME

Mac::PropertyList::SAX - work with Mac plists at a low level (with real XML parsers)

SYNOPSIS

See Mac::PropertyList

DESCRIPTION

Mac::PropertyList is useful, but very slow on large files because it does the parsing by itself, intead of handing off the actual XML parsing to a dedicated parser. This module uses XML::SAX::ParserFactory to select a parser capable of doing the heavy lifting, reducing parsing time on large files by up to 97%. This is especially useful for iTunes library plists which may be megabytes in size and contain thousands of entries in dozens of dictionaries.

This module does not, however, replace Mac::PropertyList; in fact, it depends on it for several package definitions and the plist creation routines.

Be aware that performance will depend largely on the parser that XML::SAX::ParserFactory selects for you; if you have not installed XML::SAX::Expat or another fast parser, the default XML::SAX::PurePerl parser will be used; this will probably give worse performance than Mac::PropertyList, so ensure that a fast parser is being used before you complain to me about performance :-). See XML::SAX::ParserFactory for information on how to set which parser is used.

VERSION

Version 0.01

FUNCTIONS

parse_plist_file

See "parse_plist_file" in Mac::PropertyList

parse_plist_fh

See "parse_plist_file" in Mac::PropertyList

parse_plist

See "parse_plist_file" in Mac::PropertyList

_parse

Parsing method called by parse_plist_* (internal use only)

BUGS / TODO

Behavior is not exactly the same as Mac::PropertyList's; specifically, in the case of special characters, such as accented characters and ampersands. Ampersands encoded (for example, as '&') in the original property list will be decoded by the XML parser in this module; Mac::PropertyList leaves them as-is. Also, accented/special characters are converted into '\x{ff}' sequences by the XML parser in this module, but are preserved in their original encoding by Mac::PropertyList. The differences may be evident when creating a plist file from a parsed data structure, but this has not yet been tested.

Please report any bugs or feature requests to bug-mac-propertylist-sax at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mac-PropertyList-SAX. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Mac::PropertyList::SAX

You can also look for information at:

AUTHOR

Darren M. Kulp, <darren at kulp.ch>

THANKS

brian d foy, who created the Mac::PropertyList module whose tests were appropriated for this module.

SEE ALSO

Mac::PropertyList, the inspiration for this module.

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Darren Kulp

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.