XML::Encoding(3pm)
π XML::Encoding π
okay bestie, so this is the perl manual page for XML::Encoding β a User Contributed Perl Documentation page, no cap π«Ά β and we're about to get you fully caught up. grab a snack, we're going in β¨
πΈ NAME πΈ
XML::Encoding β a perl module for parsing XML encoding maps. literally that's the whole vibe π
β¨ SYNOPSIS β¨
use XML::Encoding;
my $em_parser = new XML::Encoding(ErrorContext => 2,
ExpatRequired => 1,
PushPrefixFcn => \&push_prefix,
PopPrefixFcn => \&pop_prefix,
RangeSetFcn => \&range_set);
my $encmap_name = $em_parser->parsefile($ARGV[0]);
look at her go π so clean, so iconic.
π¦ DESCRIPTION π¦
So this module? It's built as a subclass of XML::Parser, and it gives you a parser for encoding map files β which are, plot twist, XML files. The file maps/encmap.dtd in the distribution is the one that describes the structure of these files, so that's your blueprint, bestie πβ¨
Calling a parse method returns the name of the encoding map, which it gets from the name attribute of the root element. And the contents of the map? Those get processed through the callback functions push_prefix, pop_prefix, and range_set. periodt π
π Methods π
ngl this is the tea: this module provides no additional methods to those provided by XML::Parser. BUT π it does take the following additional options, and they are lowkey the whole point:
ExpatRequiredβ when this has a true value, then an error occurs unless the encmapexpatattribute is set toyes. And whether or not theExpatRequiredoption is given, the parser enters expat mode if this attribute is set. In expat mode, the parser checks if the encoding violates expat restrictions. so it's giving security guard energy π‘οΈPushPrefixFcnβ 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. Anundefvalue should be returned if successful. If in expat mode, a defined value causes an error and is used as the message string. π so if you return something, that's a whole error now, iykykPopPrefixFcnβ the corresponding value should be a code reference to be called when a prefix element ends. No arguments are passed to this function. Anundefvalue should be returned if successful. If in expat mode, a defined value causes an error and is used as the message string. same deal, bestie πRangeSetFcnβ the corresponding value should be a code reference to be called when arangeorchelement is seen. The 3 arguments passed to this function are:(byte, unicode_scalar, length)β yes, three of them, keep up π«Ά Thebyteis the starting byte of a range or the byte being mapped by achelement. Theunicode_scalaris the Unicode value that this byte (with the current prefix) maps to. The length of the range is the last argument. This will be1for thechelement. Anundefvalue should be returned if successful. If in expat mode, a defined value causes an error and is used as the message string. π
π EXPORTS π
None.
like, absolutely nothing. she gives nothing away π
π KNOWN BUGS π
None.
not a single one, we love a flawless queen β¨
π FEEDBACK π
Patches, bug reports, suggestions or any other feedback is welcome. fr fr, they want to hear from you π«Ά
- Patches can be sent as GitHub pull requests at <https://github.com/steve-m-hay/XML-Encoding/pulls>.
- Bug reports and suggestions can be made on the CPAN Request Tracker at <https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-Encoding>.
- Currently active requests on the CPAN Request Tracker can be viewed at <https://rt.cpan.org/Public/Dist/Display.html?Status=Active;Queue=XML-Encoding>.
- Please test this distribution. See CPAN Testers Reports at <https://www.cpantesters.org/> for details of how to get involved. π§ͺ
- Previous test results on CPAN Testers Reports can be viewed at <https://www.cpantesters.org/distro/X/XML-Encoding.html>.
- Please rate this distribution on CPAN Ratings at <https://cpanratings.perl.org/rate/?distribution=XML-Encoding>. βββββ (manifesting)
π₯ SEE ALSO π₯
XML::Parser.
π¦ AVAILABILITY π¦
The latest version of this module is available from CPAN (see "CPAN" in perlmodlib for details) at
<https://metacpan.org/release/XML-Encoding> or
<https://www.cpan.org/authors/id/S/SH/SHAY/> or
<https://www.cpan.org/modules/by-module/XML/>.
The latest source code is available from GitHub at <https://github.com/steve-m-hay/XML-Encoding>. go get it bestie πββοΈπ¨
π οΈ INSTALLATION π οΈ
See the INSTALL file. yes, that one. it's right there π
π AUTHOR π
Clark Cooper <coopercc@netheaven.com <mailto:coopercc@netheaven.com>>.
Steve Hay <shay@cpan.org <mailto:shay@cpan.org>> is now maintaining XML::Encoding as of version 2.00. king behavior, honestly π
Β©οΈ COPYRIGHT Β©οΈ
Copyright (C) 1998 Clark Cooper. All rights reserved.
Copyright (C) 2007-2010, 2014, 2020 Steve Hay. All rights reserved.
π 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 GNU General Public License or the Artistic License, as specified in the LICENCE file. free, as in freedom, as in slay π
β VERSION β
Version 2.11
π DATE π
08 Dec 2020
π°οΈ HISTORY π°οΈ
See the Changes file. the lore is all in there πβ¨
okay and that's a wrap!! π this page was brought to you byperl v5.32.0, dated2020-12-10, and it's theXML::Encoding(3pm)manpage from User Contributed Perl Documentation β version2.11, for the record. go parse some encoding maps, bestie, you got this π¦ππ
π¦ where this page comes from
- debian bookworm: libxml-encoding-perl 2.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-encoding-perl 2.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libxml-encoding-perl 2.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-encoding-perl 2.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-encoding-perl 2.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-encoding-perl 2.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms