| XML-Filter-Essex documentation | Contained in the XML-Filter-Essex distribution. |
XML::Essex::NamespaceMap - ...
Contains a mapping of namespaces to prefixes.
my $map = ns_map $ns1 => $prefix1, ...; ## In Essex scripts.
my $map = XML::Essex::NamespaceMap->new(
$essex,
$ns1 => $prefix1,
...
);
my $unregistered_map = XML::Essex::NamespaceMap->new(
$ns1 => $prefix1,
...
);
No way to get at the namespaces and prefixes. Can add one when one is needed, most uses should go through the essex object to fall back to earlier mappings if a mapping doesn't happen to have a particular namespace or prefix.
Copyright 2002, R. Barrie Slaymaker, Jr., All Rights Reserved
You may use this module under the terms of the BSD, Artistic, oir GPL licenses, any version.
Barrie Slaymaker <barries@slaysys.com>
| XML-Filter-Essex documentation | Contained in the XML-Filter-Essex distribution. |
package XML::Essex::NamespaceMap; $VERSION = 0.000_1;
use strict;
sub new { my $proto = shift; my $essex; $essex = shift if @_ && UNIVERSAL::isa( $_[0], "XML::Essex" ); my %map = @_; my $self = bless { Essex => $essex, Map => \%map, }, ref $proto || $proto; $self->{Essex}->add_namespace_map( $self->{Map} ) if $self->{Essex}; return $self; } sub DESTROY { my $self = shift; if ( $self->{Essex} ) { $self->{Essex}->remove_namespace_map( $self->{Map} ); } else { ## Clear out the map in case it was added to an Essex ## we don't happen to refer to. %{$self->{Map}} = (); } }
1;