Ian Stuart > MathML-Entities-Approximate > MathML::Entities::Approximate

Download:
MathML-Entities-Approximate-0.20.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.20   Source  

NAME ^

  MathML::Entities::Approximate - Returns approximated ASCII characters for XHTML+MathML Named Entities

SYNOPSIS ^

A subclass of MathML::Entities that supplies ASCII-approximate characters for XHTML+MathML Named Entities.

  use lib (getpwnam('sdadmin'))[7] . '/perlib';
  use MathML::Entities::Approximate;

  $html    = '<strong>avanc&eacute;e</strong>';

  # convert to HTML character reference. Standard MathML::Entities
  $numeric = name2numbered($html)    # <strong>avanc&#x000E9;e</strong>

  # convert to standard ASCII
  $ascii   = name2approximated($html) # <strong>avancee</strong>

  # Muck around with the lookup table...
  MathML::Entities::Approximate::getSet(aacute);    # returns 'a'
  MathML::Entities::Approximate::getSet(aacute, z); # returns 'z'
  MathML::Entities::Approximate::getSet(aacute);    # now returns 'z'

DESCRIPTION ^

MathML::Entities::Approximate is a content conversion filter for named XHTML+MathML entities. There are over two thousand named entities in the XHTML+MathML DTD, however only a fraction of them are variants on standard ASCII characters.

A string is parsed and every Named Entity is converted to a reasonable ASCII (7-bit ASCII set), or removed from the string.

FUNCTIONS ^

There two functions, one of which is exported by default.

AUTHOR ^

Ian Stuart <Ian.Stuart@ed.ac.uk>

COPYRIGHT ^

Copyright (c) 2005 Ian Stuart. 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 ^

MathML::Entities, HTML::Entities, HTML::Entities::Numbered, http://www.w3.org/TR/REC-html40/sgml/entities.html, http://www.w3.org/Math/characters/

syntax highlighting: