Rechercher une page de manuel
XML::SAX::DocumentLocator.3pm
Langue: en
Version: 2002-01-22 (openSuse - 09/10/07)
Section: 3 (Bibliothèques de fonctions)
Sommaire
NAME
XML::SAX::DocumentLocator - Helper class for document locatorsSYNOPSIS
my $locator = XML::SAX::DocumentLocator->new( sub { $object->get_public_id }, sub { $object->get_system_id }, sub { $reader->current_line }, sub { $reader->current_column }, );
DESCRIPTION
This module gives you a tied hash reference that calls the specified closures when asked for PublicId, SystemId, LineNumber and ColumnNumber.It is useful for writing SAX Parsers so that you don't have to constantly update the line numbers in a hash reference on the object you pass to set_document_locator(). See the source code for XML::SAX::PurePerl for a usage example.
API
There is only 1 method: "new". Simply pass it a list of closures that when called will return the PublicId, the SystemId, the LineNumber and the ColumnNumber, respectively.The closures are passed a single parameter, the key being requested. But you're free to ignore that.
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre