GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  HTML::ENTITIES::NUMBERED (3)

.ds Aq ’

NAME

HTML::Entities::Numbered - Conversion of numbered HTML entities

CONTENTS

SYNOPSIS



 use HTML::Entities::Numbered;

 $html    = Hi Honey<b>♥</b>;

 # convert named HTML entities to numbered (decimal)
 $decimal = name2decimal($html);    # Hi Honey<b>♥</b>

 # to numbered (hexadecimal)
 $hex     = name2hex($html);        # Hi Honey<b>♥</b>

 $content = Copyright © Larry Wall;

 # convert numbered HTML entities (decimal) to named
 $name1   = decimal2name($content); # Copyright © Larry Wall

 $content = Copyright © Larry Wall;
 # convert numbered HTML entitites (hexadecimal) to named
 $name2   = hex2name($content);     # Copyright © Larry Wall

 $xml     = "Give me ¥10,000" > cherie♠;

 # convert named HTML entities to numbered
 # except valid XML entities (decimal)
 $decimal = name2decimal_xml($xml); # "Give me ¥10,000"
                                    # > cherie♠

 # to numbered except valid XML entities (hexdecimal)
 $hex     = name2hex_xml($xml);     # "Give me ¥10,000"
                                    # > cherie♠



DESCRIPTION

HTML::Entities::Numbered is a content conversion filter for named HTML entities (symbols, mathmetical symbols, Greek letters, Latin letters, etc.). When an argument of name2decimal() or name2hex() contains some <B>nameableB> HTML entities, they will be replaced to numbered HTML entities. And when an argument of name2decimal_xml() or name2hex_xml() contains some <B>nameableB> numbered HTML entities, they will be replaced to numbered HTML entities <B>except valid XML entitiesB> (the excepted valid XML entities are the following five entities: <, >, &, ", '). By the same token, when an argument of decimal2name() or hex2name() contains some <B>nameableB> numbered HTML entities, they will be replaced to named HTML entities.

(the exception valid XML entities means the following five entities: <, >, &, ", ')

On version 0.03, the entities hash table is imported from HTML::Entities (with obsolete class HTML::Entities::Numbered::Extra for older releases of Perl). At the moment, 0.04 (or later) is included HTML::Entities::Numbered::Table to import HTML entities table, and thereby we do not need to have HTML::Entities (included in HTML::Parser distribution).

This may be also useful for making valid XML (corrects the undefined entity references, and enhanced by addition of functions conform to the XML).

FUNCTIONS

Following all functions are exported by default.
o name2decimal

Some included named HTML entities in argument of name2decimal() will be replaced to decimal numbered HTML entities.

o name2hex

Some included named HTML entities in argument of name2hex() will be replaced to hexadecimal numbered HTML entities.

o decimal2name

Some include decimal numbered HTML entities in argument of decimal2name() will be replaced to named HTML entities (If they’re nameable).

o hex2name

Some include hexadecimal numbered HTML entities in argument of hex2name() will be replaced to named HTML entities (If they’re nameable).

o name2decimal_xml

Some included named HTML entities in argument of name2decimal_xml() will be replaced to decimal numbered HTML entities <B>except valid XML entitiesB>.

o name2hex_xml

Some included named HTML entities in argument of name2hex_xml() will be replaced to hexadecimal numbered HTML entities <B>except valid XML entitiesB>.

If you’d prefer not to import them functions into the caller’s namespace, you can call them as below:



 use HTML::Entities::Numbered ();

 $decimal = HTML::Entities::Numbered::name2decimal($str);
 $hex     = HTML::Entities::Numbered::name2hex($str);
 $named1  = HTML::Entities::Numbered::decimal2name($str);
 $named2  = HTML::Entities::Numbered::hex2name($str);
 $decimal = HTML::Entities::Numbered::name2decimal_xml($str);
 $hex     = HTML::Entities::Numbered::name2hex_xml($str);



AUTHOR

Koichi Taniguchi <taniguchi@livedoor.jp>

Develop triggered by IKEBE Tomohiro <ikebe@cpan.org>

Many thanks to Tatsuhiko Miyagawa <miyagawa@cpan.org>

COPYRIGHT

Copyright (c) 2004 Koichi Taniguchi. Japan. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

HTML::Entities, <http://www.w3.org/TR/REC-html40/sgml/entities.html>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HTML::ENTITIES::NUMBERED (3) 2004-09-02

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.