Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    AxKit2::XSP::SimpleTaglib 1.1

    Download button

    No screenshots available
    Downloads: 315  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jorg Walter | More programs
    Perl Artistic License / FREE
    September 13th, 2006, 05:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    AxKit2::XSP::SimpleTaglib description

    AxKit2::XSP::SimpleTaglib is an alternate XSP taglib helper.

    AxKit2::XSP::SimpleTaglib is an alternate XSP taglib helper.

    SYNOPSIS

    package Your::XSP::Package;
    use AxKit2::XSP::SimpleTaglib;

    ... more initialization stuff, start_document handler, utility functions, whatever
    you like, but no parse_start/end handler needed - if in doubt, just leave empty ...

    sub some_tag : XSP_attrib(id) XSP_attribOrChild(some-param) XSP_node(result) XSP_keepWhitespace {
    my ($tag, $attr, $stack, $struct) = @_;
    return do_something($$attr{'some-param'},$$attr{'id'});
    }

    # old style usage no longer documented, but still supported

    This taglib helper allows you to easily write tag handlers with most of the common behaviours needed. It manages all 'Design Patterns' from the XSP man page plus several other useful tag styles, including object-like access as in ESQL.

    Simple handler subs

    A tag "" will trigger a call to sub "foo" during the closing tag event. What happens in between can be configured in many ways using Perl function attributes. In the rare cases where some action has to happen during the opening tag event, you may provide a sub "foo__open" (double underscore) which will be called at the appropriate time. Usually you would only do that for 'if'- style tags which enclose some block of code. 'if'-style tags usually also need the XSP_compile flag.

    Contrary to the former behaviour, your tag handler is called during the XSP execution stage, so you should directly return the result value. The XSP_compile flag is available to have your handler called in the parse stage, when the XSP script is being constructed. Then, it is the responsibility of the handler to return a Perl code fragment to be appended to the XSP script.
    As a comparison, TaglibHelper subs are strictly run-time called, while plain taglibs without any helper are strictly compile-time called.

    Warning: The old usage is still fully supported, but you should not use it anymore. It may become deprecated in a future release and will be removed entirely afterwards. Porting it to the new style usage is quite easy: remove the line reading "package your-taglib::Handler;", then prefix "XSP_" to all Perl attributes (e.g., "childStruct" becomes "XSP_childStruct"), and add "XSP_compile" to every handler sub. If after your refactoring some handler sub doesn't carry any Perl attribute anymore, add a plain "XSP" Perl attribute.

    Perl attributes without the 'XSP_' prefix cause a warning (actually, sometimes even two, one from Perl and one from SimpleTaglib), as lower-case Perl attributes are reserved for Perl itself.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    XSP taglib | taglib helper | Perl module | AxKit2::XSP::SimpleT | XSP | taglib

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM