<<

NAME

Web::Pro::Transform - Perl extension for blah blah blah

SYNOPSIS

   use Web::Pro::Transform qw( text2xml );
   [...]
   $node->set_body( text2xml( $rawtext_ref ) );

DESCRIPTION

A collection of proceedurally oriented functions for transformations of text to and from different markup languages.

This is a set of utilities to facilitate the Web::Chain project (for improving "doomfiles" processing).

EXPORT

All of the following functions are OK for export:

text2xml - takes df-style block of text, transforms it into xml used in internal storage.

xml2html - takes content in internal xml format, transform it into html for web publication.

html2xml_simple - takes raw html content, tweaks it into internally used xml storage format. This is currently in use because the following html2xml displays a bug in converting html comments into ampersand entities. You might presume that html2xml would be more robust (it seems to make fewer assumptions about the input html being reasonably clean (e.g. ampersand entities used correctly), but it's doing something peculiar so this is the fall back.

html2xml - like html2xml_simple, but makes fewer assumptions about how clean the initial html is: converts to text first, then from text to xml

xml2text - takes df-style block of text, transforms it into xml used in internal storage.

text2html - given reference to block of df material in raw text form convert to html form (primarily, this means identifing links and changing them to HREF form). Example usage:

    $bodyref = text2html( $node->get_body );
    print $fh ${ bodyref };
html2text - inverse transform of the above. Essentially just strips out html tags. Leaves whitespace alone (presumes this html was wrapped in PRE tags, and hence has significant whitespace). It is very similar to xml2text, above.

Internally used functions

ampup - transform < > & into XML/HTML ampersand entities Acts directly on the given string. Example: amup($text)

deamp - reverses the ampup transform, turns XML/HTML ampersand entities back into: < > & Acts directly on the given string. Example: deamp($text)

SEE ALSO

Project Documentation

AUTHOR

Joseph Brenner, <doom@kzsu.stanford.edu>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Joseph Brenner

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.

BUGS

None reported... yet.

<<