.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML::Encoding 3pm" .TH XML::Encoding 3pm "2020-12-10" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XML::Encoding \- A perl module for parsing XML encoding maps. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 6 \& use XML::Encoding; \& my $em_parser = new XML::Encoding(ErrorContext => 2, \& ExpatRequired => 1, \& PushPrefixFcn => \e&push_prefix, \& PopPrefixFcn => \e&pop_prefix, \& RangeSetFcn => \e&range_set); \& \& my $encmap_name = $em_parser\->parsefile($ARGV[0]); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module, which is built as a subclass of XML::Parser, provides a parser for encoding map files, which are \s-1XML\s0 files. The file maps/encmap.dtd in the distribution describes the structure of these files. Calling a parse method returns the name of the encoding map (obtained from the name attribute of the root element). The contents of the map are processed through the callback functions push_prefix, pop_prefix, and range_set. .SS "Methods" .IX Subsection "Methods" This module provides no additional methods to those provided by XML::Parser, but it does take the following additional options. .IP "\(bu" 4 ExpatRequired .Sp When this has a true value, then an error occurs unless the encmap \&\*(L"expat\*(R" attribute is set to \*(L"yes\*(R". Whether or not the ExpatRequired option is given, the parser enters expat mode if this attribute is set. In expat mode, the parser checks if the encoding violates expat restrictions. .IP "\(bu" 4 PushPrefixFcn .Sp The corresponding value should be a code reference to be called when a prefix element starts. The single argument to the callback is an integer which is the byte value of the prefix. An undef value should be returned if successful. If in expat mode, a defined value causes an error and is used as the message string. .IP "\(bu" 4 PopPrefixFcn .Sp The corresponding value should be a code reference to be called when a prefix element ends. No arguments are passed to this function. An undef value should be returned if successful. If in expat mode, a defined value causes an error and is used as the message string. .IP "\(bu" 4 RangeSetFcn .Sp The corresponding value should be a code reference to be called when a \&\*(L"range\*(R" or \*(L"ch\*(R" element is seen. The 3 arguments passed to this function are: (byte, unicode_scalar, length) The byte is the starting byte of a range or the byte being mapped by a \&\*(L"ch\*(R" element. The unicode_scalar is the Unicode value that this byte (with the current prefix) maps to. The length of the range is the last argument. This will be 1 for the \*(L"ch\*(R" element. An undef value should be returned if successful. If in expat mode, a defined value causes an error and is used as the message string. .SH "EXPORTS" .IX Header "EXPORTS" \&\fINone\fR. .SH "KNOWN BUGS" .IX Header "KNOWN BUGS" \&\fINone\fR. .SH "FEEDBACK" .IX Header "FEEDBACK" Patches, bug reports, suggestions or any other feedback is welcome. .PP Patches can be sent as GitHub pull requests at . .PP Bug reports and suggestions can be made on the \s-1CPAN\s0 Request Tracker at . .PP Currently active requests on the \s-1CPAN\s0 Request Tracker can be viewed at . .PP Please test this distribution. See \s-1CPAN\s0 Testers Reports at for details of how to get involved. .PP Previous test results on \s-1CPAN\s0 Testers Reports can be viewed at . .PP Please rate this distribution on \s-1CPAN\s0 Ratings at . .SH "SEE ALSO" .IX Header "SEE ALSO" XML::Parser. .SH "AVAILABILITY" .IX Header "AVAILABILITY" The latest version of this module is available from \s-1CPAN\s0 (see \&\*(L"\s-1CPAN\*(R"\s0 in perlmodlib for details) at .PP or .PP or .PP . .PP The latest source code is available from GitHub at . .SH "INSTALLATION" .IX Header "INSTALLATION" See the \fI\s-1INSTALL\s0\fR file. .SH "AUTHOR" .IX Header "AUTHOR" Clark Cooper >. .PP Steve Hay > is now maintaining XML::Encoding as of version 2.00. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 1998 Clark Cooper. All rights reserved. .PP Copyright (C) 2007\-2010, 2014, 2020 Steve Hay. All rights reserved. .SH "LICENCE" .IX Header "LICENCE" This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e. under the terms of either the \s-1GNU\s0 General Public License or the Artistic License, as specified in the \fI\s-1LICENCE\s0\fR file. .SH "VERSION" .IX Header "VERSION" Version 2.11 .SH "DATE" .IX Header "DATE" 08 Dec 2020 .SH "HISTORY" .IX Header "HISTORY" See the \fIChanges\fR file.