Thread

Posted on Fri Apr 13 15:19:11 2007 by flobadob
sax parser not working in mason. works from shell.
Hello, my website is xml driven and I have a sax parser which goes through the xml, and outputs a clientname,username and password whereever it encounters one. The parser returns many such occurances when run from the shell, but only one row when run from within mason. Stumped. Could there be an error raised when run within mason which I can't see? How do I get access to such an error? Here is the mason code and sax parser if that helps...
<%init> # extract the client/username/password list... my $list; my $wr = XML::SAX::Writer->new(Output => \$list); my $ex = AMI::SAXFilter::ClientUserPwdList->new(Handler => $wr); my $pz = XML::SAX::ParserFactory->parser(Handler => $ex); $pz->parse_uri($xmlfile); print $list; </%init>
...and the SAX parser itself...
package AMI::SAXFilter::ClientUserPwdList; use strict; #use base qw(XML::SAX::Base); use XML::SAX::Base; use vars qw/@ISA/; @ISA = qw/XML::SAX::Base/; my $lastclient; sub start_element { my ($self, $element) = @_; if( $element->{Name} eq "client" ) { my %attrs = %{$element->{Attributes}}; my $nameref = $attrs{'{}name'}; $lastclient = $nameref->{Value}; } elsif( $element->{Name} eq "auth" ) { my %attrs = %{$element->{Attributes}}; my $usernameref = $attrs{'{}username'}; my $passwordref = $attrs{'{}passwor +d'}; my $username = $usernameref->{Value}; my $password = $passwordref->{Value}; my $row = $lastclient . $username . $password; $self->SUPER::characters({Data => $row}); } } sub end_element { } sub characters { } sub start_cdata { } sub end_cdata { } 1;
Direct Responses: 5599 | Write a response
Posted on Sun Jul 1 20:32:14 2007 by jsmietan in response to 4845
Re: sax parser not working in mason. works from shell.
Try run Sax2 -r from root console . Then system will be get config info from cache and go to text mode login. Login as root and Sax2 will be running properly. You will be can change resolution for monitor and display for X- enviroment . Next time you are run Sax2 it will be run normally Perhaps another program was change config for X Window Best regard jsmietan Jerzy Smietanski
Write a response