AxKit2

 view release on metacpan or  search on metacpan

plugins/spod5  view on Meta::CPAN

                               );
    
    # print "Interim doc: ", $interim->toString;

    my $stylesheet = $xslt->parse_stylesheet($parser->parse_string($pod2s5));
    my $output = $stylesheet->transform($interim);
    
    my $ct  = $stylesheet->media_type;
    my $enc = $stylesheet->output_encoding;
    my $out = $stylesheet->output_string($output);

    $client->headers_out->header('Content-Length', bytelength($out));
    $client->headers_out->header('Content-Type', "$ct; charset=$enc");
    $client->send_http_headers;
    $client->write($out);
    
    return DONE;
}

$add_params = <<'EOT';
<xsl:stylesheet version="1.0"  
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    >

<xsl:param name="base"/>
<xsl:param name="style">slides.css</xsl:param>
<xsl:param name="uidir">default</xsl:param>

<xsl:template match="/pod">
  <pod>
    <meta>
        <base><xsl:value-of select="$base"/></base>
        <ui-dir><xsl:value-of select="$uidir"/></ui-dir>
        <slides><xsl:value-of select="$style"/></slides>
        <xsl:apply-templates select='meta'/>
    </meta>
    <xsl:apply-templates/>
  </pod>
</xsl:template>

<xsl:template match="meta">
    <xsl:element name="{substring-before(./text(), ' ')}">
        <xsl:value-of select="substring-after(./text(), ' ')"/>
    </xsl:element>
</xsl:template>

<xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-templates select="*|@*|node()"/>
    </xsl:copy>
</xsl:template>

</xsl:stylesheet>
EOT

$pod2s5 = <<'EOT';
<xsl:stylesheet version="1.0"  
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    >

<xsl:output method="html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
                          doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
                          indent="yes"/>

<xsl:template match="/pod">
    <html>
    
    <head>
    <title><xsl:value-of select="meta/title"/></title>
    <!-- metadata -->
    <meta name="generator" content="spod5" />
    <meta name="version" content="S5 1.1" />
    <meta name="presdate" content="{meta/presdate}" />
    <meta name="author" content="{meta/author}" />
    <meta name="company" content="{meta/company}" />
    
    <!-- configuration parameters -->
    <meta name="defaultView" content="{meta/view or 'slideshow'}" />
    <meta name="controlVis" content="{meta/controls or 'hidden'}" />
    
    <base href="{meta/base}ui/{meta/ui-dir}/"/>
    
    <!-- style sheet links -->
    <link rel="stylesheet" href="{meta/slides}" type="text/css" media="projection" id="slideProj" />
    <link rel="stylesheet" href="outline.css" type="text/css" media="screen" id="outlineStyle" />
    <link rel="stylesheet" href="print.css" type="text/css" media="print" id="slidePrint" />
    <link rel="stylesheet" href="opera.css" type="text/css" media="projection" id="operaFix" />
    
    <!-- S5 JS -->
    <script src="slides.js" type="text/javascript"></script>
    
    <style type="text/css">
    <!--
    /* 
     * perltidy's styles
     */
    .c  { color: #228B22;                    } /* comment */
    .cm { color: #000000;                    } /* comma */
    .co { color: #000000;                    } /* colon */
    .h  { color: #CD5555; font-weight:bold;  } /* here-doc-target */
    .hh { color: #CD5555; font-style:italic; } /* here-doc-text */
    .i  { color: #00688B;                    } /* identifier */
    .j  { color: #000000; font-weight:bold;  } /* label */
    .k  { color: #8B4513; font-weight:bold;  } /* keyword */
    .m  { color: #FF0000; font-weight:bold;  } /* subroutine */
    .n  { color: #B452CD;                    } /* numeric */
    .p  { color: #000000;                    } /* paren */
    .pd { color: #228B22; font-style:italic; } /* pod-text */
    .pu { color: #000000;                    } /* punctuation */
    .q  { color: #CD5555;                    } /* quote */
    .s  { color: #000000;                    } /* structure */
    .sc { color: #000000;                    } /* semicolon */
    .v  { color: #B452CD;                    } /* v-string */
    .w  { color: #000000;                    } /* bareword */
    
    /* ====================================================================== *
     * Sample stylesheet for Syntax::Highlight::HTML                          *
     *                                                                        *
     * Copyright (C)2004 Sebastien Aperghis-Tramoni, All Rights Reserved.     *
     *                                                                        *
     * This file is free software; you can redistribute it and/or modify      *



( run in 1.181 second using v1.01-cache-2.11-cpan-6aa56a78535 )