XML::Entities man page on Fedora
[printable version]
XML::Entities(3) User Contributed Perl Documentation XML::Entities(3)
NAME
XML::Entities - Decode strings with XML entities
SYNOPSIS
use XML::Entities;
$a = "Tom & Jerry © Warner Bros.";
$b = XML::Entities::decode('all', $a);
$c = XML::Entities::numify('all', $a);
# now $b is "Tom & Jerry X Warner Bros.
# and $c is "Tom & Jerry © Warner Bros."
# void context modifies the arguments
XML::Entities::numify('all', $a);
XML::Entities::decode('all', $a, $c);
# Now $a, $b and $c all contain the decoded string
DESCRIPTION
Based upon the HTML::Entities module by Gisle Aas
This module deals with decoding of strings with XML character entities.
The module provides two functions:
decode( $entity_set, $string, ... )
This routine replaces XML entities from $entity_set found in the
$string with the corresponding Unicode character. Unrecognized
entities are left alone.
The $entity_set can either be a name of an entity set - the
selection of which can be obtained by XML::Entities::Data::names(),
or "all" for a union, or alternatively a hashref which maps entity
names (without leading &'s) to the corresponding Unicode characters
(or strings).
If multiple strings are provided as argument they are each decoded
separately and the same number of strings are returned.
If called in void context the arguments are decoded in-place.
Note: If your version of "HTML::Parser" was built without Unicode
support, then "XML::Entities" uses a regular expression to do the
decoding, which is slower.
numify( $entity_set, $string, ... )
This functions converts named XML entities to numeric XML entities.
It is less robust than the "decode" function in the sense that it
doesn't capture improperly terminated entities. It behaves like
"decode" in treating parameters and returning values.
XML::Entities::Data
The list of entities is defined in the XML::Entities::Data module. The
list can be generated from the w3.org definition (or any other). Check
"perldoc XML::Entities::Data" for more details.
SEE ALSO
HTML::Entities, XML::Entities::Data
COPYRIGHT
Copyright 2010 Jan Oldrich Kruza <sixtease@cpan.org>. All rights
reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
perl v5.14.1 2010-08-26 XML::Entities(3)
[top]
List of man pages available for Fedora
Copyright (c) for man pages and the logo by the respective OS vendor.
For those who want to learn more, the polarhome community provides shell access and support.
[legal]
[privacy]
[GNU]
[policy]
[cookies]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
|
Vote for polarhome
|