Apache-AxKit-Plugin-AddXSLParams-Request

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    Offers fine-grained access to the URI requested (via Apache::URI's
    parse_uri() method.

    Param Prefix: request.uri.*

    Implemented Fields:

    * scheme
    * hostinfo
    * user
    * password
    * hostname
    * port
    * path
    * rpath
    * query
    * fragment

    Examples:

      <xsl:param name="request.uri.path"/>

Request.pm  view on Meta::CPAN

        $cgi->parms->set('request.uri' => $r->uri );
        $cgi->parms->set('request.filename' => $r->filename);
        $cgi->parms->set('request.method' => $r->method);
        $cgi->parms->set('request.path_info' => $r->path_info) if length( $r->path_info ) > 0;
    }

    # verbose URI parameters
    if ( grep { $_ eq 'VerboseURI' } @allowed_groups ) {
        my $parsed_uri = $r->parsed_uri;

        my @uri_methods = qw( scheme hostinfo user password hostname port path rpath query fragment );
          
        foreach my $method ( @uri_methods ) {
            my $value = $parsed_uri->$method();
            $cgi->parms->set('request.uri.' . $method => $value ) if length $value > 0;
        }
    }
    return OK;
}

1;

Request.pm  view on Meta::CPAN

B<Implemented Fields>:

=over 4

=item * scheme

=item * hostinfo

=item * user

=item * password

=item * hostname

=item * port

=item * path

=item * rpath

=item * query

examples/paramtest.xsl  view on Meta::CPAN



<xsl:output method="html" />
<!-- URI params -->
<xsl:param name="request.uri.path">--</xsl:param>
<xsl:param name="request.uri.scheme">--</xsl:param>
<xsl:param name="request.uri.port">--</xsl:param>
<xsl:param name="request.uri.rpath">--</xsl:param>
<xsl:param name="request.uri.query">--</xsl:param>
<xsl:param name="request.uri.user">--</xsl:param>
<xsl:param name="request.uri.password">--</xsl:param>
<xsl:param name="request.uri.fragment">--</xsl:param>
<!-- end URI params -->

<!-- HTTPHeader params -->
<xsl:param name="request.headers.accept">--</xsl:param>
<xsl:param name="request.headers.content-type">--</xsl:param>
<xsl:param name="request.headers.accept-charset">--</xsl:param>
<xsl:param name="request.headers.accept-encoding">--</xsl:param>
<xsl:param name="request.headers.accept-language">--</xsl:param>
<xsl:param name="request.headers.connection">--</xsl:param>

examples/paramtest.xsl  view on Meta::CPAN

      <tr>
       <td>request.uri.rpath</td><td><xsl:value-of select="$request.uri.rpath"/></td>
      </tr>
      <tr>
       <td>request.uri.query</td><td><xsl:value-of select="$request.uri.query"/></td>
      </tr>
      <tr>
       <td>request.uri.user</td><td><xsl:value-of select="$request.uri.user"/></td>
      </tr>
      <tr>
       <td>request.uri.password</td><td><xsl:value-of select="$request.uri.password"/></td>
      </tr>
      <tr>
       <td>request.uri.fragment</td><td><xsl:value-of select="$request.uri.fragment"/></td>
      </tr>
    </table>
    </body>
  </html>
</xsl:template>

</xsl:stylesheet>



( run in 0.537 second using v1.01-cache-2.11-cpan-49f99fa48dc )