Skip Menu |

This queue is for tickets about the XML-SAX-Base CPAN distribution.

Report information
The Basics
Id: 610
Status: new
Priority: 0/
Queue: XML-SAX-Base

People
Owner: Nobody in particular
Requestors: merijn [...] e-factory.nl
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: passiing options to parsers not possible
Hi, I encountered this bug when i tried to use the ProtocolEncoding option of the expat parser. The parser function doesnt seem to pass on options to the _parser_* functions. I made a quick fix that seem to work with the following code: #-------------------------------------------------------------------# # $p->parse(%options) #-------------------------------------------------------------------# sub parse { my $self = shift; my $parse_options = $self->get_options(@_); local $self->{ParseOptions} = $parse_options; if ($self->{Parent}) { # calling parse on a filter for some reason return $self->{Parent}->parse($parse_options); } else { my $method; if (defined $parse_options->{Source}{CharacterStream} and $method = $self->can('_parse_characterstream')) { warn("parse charstream???\n"); return $method->($self, $parse_options->{Source}{CharacterStream},$parse_options); } elsif (defined $parse_options->{Source}{ByteStream} and $method = $self->can('_parse_bytestream')) { return $method->($self, $parse_options->{Source}{ByteStream},$parse_options); } elsif (defined $parse_options->{Source}{String} and $method = $self->can('_parse_string')) { return $method->($self, $parse_options->{Source}{String},$parse_options); } elsif (defined $parse_options->{Source}{SystemId} and $method = $self->can('_parse_systemid')) { return $method->($self, $parse_options->{Source}{SystemId},$parse_options); } else { die "No _parse_* routine defined on this driver (if it a filter, remember to set the Parent property) [$self]"; } } } (sidenote: XML::SAX::Expat has the same kind of problem in its _create_parser function, so if you use the expat parser to test this, you have to make a quick fix there too. I reported that to the XML::SAX::Expat bugtracking on CPAN.) Feel free to contact me if needed, Merijn van den Kroonenberg
From: Merijn van den Kroonenberg
[Merijn van den Kroonenberg - Wed May 15 11:24:27 2002]: Hello, I think this is a false bug report, following the SAX standard there should be no option passing at all, sorry about this (thanks to robert berjon for pointing that out to me) Merijn van den Kroonenberg Show quoted text
> Hi, > > I encountered this bug when i tried to use the ProtocolEncoding option > of the expat parser. The parser function doesnt seem to pass on > options to the _parser_* functions. > > I made a quick fix that seem to work with the following code: >