Re: [PATCH] attribute namespace bug in XML::SAX::PurePerl
by Eric Prud'hommeaux other posts by this author
Oct 16 2005 2:32AM messages near this date
view in the new Beta List Site
Re: [PATCH] attribute namespace bug in XML::SAX::PurePerl
|
Namespace support in SAX serialisers
& XSLT On Sat, Oct 15, 2005 at 09:04:34PM +0200, Bjoern Hoehrmann wrote:
> * Eric Prud'hommeaux wrote:
> >BTW: if anyone knows a better way to resolve namespaced attribute
> >values, let me know.
>
> Listen to start_prefix_mapping / end_prefix_mapping events and keep
> track of the declarations. http://perl-xml.sourceforge.net/perl-sax/
> has all the details.
Yeah, I noticed start_prefix_mapping just as I was finishing
NamespaceStream. I debuggined NamespaceStream, then switched
over to using {start,end}_prefix_mapping. Thanks for the added
initiative.
For other folks' info:
sub new {
...
$self-> {NSHelper} = XML::NamespaceSupport->new({xmlns => 1});
sub start_prefix_mapping {
my ($self, $mapping) = @_;
$self-> {NSHelper}->declare_prefix($mapping->{Prefix},
$mapping-> {NamespaceURI});
}
sub end_prefix_mapping {
my ($self, $mapping) = @_;
$self-> {NSHelper}->undeclare_prefix($mapping->{Prefix});
}
sub start_element {
my ($self, $data) = @_;
...
my ($ns, $prefix, $lname) =
$self-> {NSHelper}->process_element_name($data->{LocalName});
--
-eric
office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
Shonan Fujisawa Campus, Keio University,
5322 Endo, Fujisawa, Kanagawa 252-8520
JAPAN
+1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell: +81.90.6533.3882
(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.
Attachments:
signature.asc
unknown1
unknown2
unknown3
Thread:
Eric Prud'hommeaux
Bjoern Hoehrmann
Eric Prud'hommeaux
|