XML::SAX::DocumentLocator(3pm) User Contributed Perl Documentation XML::SAX::DocumentLocator(3pm)
NAME
XML::SAX::DocumentLocator - Helper class for document locators
SYNOPSIS
my $locator = XML::SAX::DocumentLocator->new(
sub { $object->get_public_id },
sub { $object->get_system_id },
sub { $reader->current_line },
sub { $reader->current_column },
sub { $reader->get_encoding },
sub { $reader->get_xml_version },
);
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, the ColumnNumber, the Encoding and the
XMLVersion respectively.
The closures are passed a single parameter, the key being requested. But you're free to
ignore that.
perl v5.32.1 2021-09-04 XML::SAX::DocumentLocator(3pm)
Generated by $Id: phpMan.php,v 4.55 2007/09/05 04:42:51 chedong Exp $ Author: Che Dong
On Apache
Under GNU General Public License
2025-11-29 18:31 @216.73.216.105 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)