Tim Peoples wrote:
>
> Thanks for the info!
>
> I took a look at your module and realized that I didn't really want to
> parse the user agent string inside XSLT. Therefore, I used your code as
> a catalyst for the following quick and dirty hack.
:-)
I'd be willing to integrate your code in to AddXSLParams as an info
group like VerboseUA if a) you don't mind, and b) other folks find
useful too. What say you, AxKittens?
FWIW, I thought about doing something similar while I was writing it,
and determined that handling UA rendering discrepancies is perhaps best
done as the last transformation stage via separate stylesheets and
StyleChooser::UA, rather than modes within a single stylesheet; but
<shrug/>.
Yer thoughts?
-kip
>
> I include this here in case anyone else finds it useful. Sorry for the
> lack of docs... like I said, it was a quick hack... :-)
>
> n.b. It requires HTTP::BrowserDetect (available on CPAN)
>
> Tim.
>
> package Apache::AxKit::Plugin::BrowserDetect;
>
> use strict;
> use Apache::Constants;
> use Apache::Request;
> use HTTP::BrowserDetect;
> use vars qw( $VERSION );
>
> $VERSION = '1.00';
>
> sub handler {
> my $r = shift;
> my $a = Apache::Request->instance($r);
> my $bd = new HTTP::BrowserDetect;
>
> my $vendor =
> ($bd->opera) ? 'OPERA' :
> ($bd->konqueror) ? 'KONQ' :
> ($bd->ie) ? 'MSIE' :
> ($bd->gecko) ? 'NS6' :
> ($bd->netscape) ? 'NS4' : 'OTHER';
>
> my $platform =
> ($bd->unix) ? 'UNIX' :
> ($bd->windows) ? 'WINDOWS' :
> ($bd->mac) ? 'MAC' : 'OTHER';
>
> $a->parms->set('browser.vendor', $vendor);
> $a->parms->set('browser.platform', $platform);
> $a->parms->set('browser.version', $bd->version);
> $a->parms->set('browser.version.major', $bd->major);
> $a->parms->set('browser.version.minor', $bd->minor);
>
> return OK;
> }
>
> 1;
>
> __END__
>
> On Mon, Apr 08, 2002 at 11:53:23AM -0400, Kip Hampton wrote:
> >
> > Hi Tim,
> >
> > What you seek is already implemented in
> > AxKit-Plugin-AddXSLParams-Request[1]. One of these days, I'll get around
> > to shoving it out to CPAN. See the docs for usage, if you have any
> > questions or comments, please feel free.
> >
> > -kip
> >
> > [1]
> >
>http://hampton.ws/download/files/Apache-AxKit-Plugin-AddXSLParams-Request-1.00.tar.gz
> >
> > Tim Peoples wrote:
> > >
> > > I currently have a snippet of code that parses the HTTP_USER_AGENT env
> > > variable and sets a short attribute on the root element of my XML document
> > > (this is done in Mason using Apache::Filter).
> > >
> > > I would much rather this be done by Apache itself and have it pass a
> > > parameter to the toplevel stylesheet (where I can capture it with an
> > > <xsl:param> element).
> > >
> > > Any pointers on how I might do something like this would be greatly
> > > appriciated.
> > >
> > > Thanx,
> > > Tim.
> > >
> >
>
> --
> __________________________________________________________________
> \ \ Timothy E. Peoples
> \ c o l l e c t i v e Engineering Manager
> \ \ [EMAIL PROTECTED]
>
> DTA - Death To Acronyms
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
print join ' ', map { ucfirst($_->getFirstChild->getData)}
XML::LibXML->new()->parse_string(join '', pack "c*", (60, 122, 62, 60,
97, 62, 106, 117, 115, 116, 60, 47, 97, 62, 60, 98, 62, 97, 110, 111,
116, 104, 101, 114, 60, 47, 98, 62, 60, 99, 62, 112, 101, 114, 108, 60,
47, 99, 62, 60, 100, 62, 88, 77, 76, 60, 47, 100, 62, 60, 101, 62, 104,
97, 99, 107, 101, 114, 60, 47, 101, 62, 60, 47, 122,
62))->findnodes('//*[name() != "z"]')->get_nodelist;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]