NAME

URI::NamespaceMap - Class holding a collection of namespaces

VERSION

Version 1.09_01

SYNOPSIS

use URI::NamespaceMap;
my $map = URI::NamespaceMap->new( { xsd => 'http://www.w3.org/2001/XMLSchema#' } );
$map->namespace_uri('xsd')->as_string;
my $foaf = URI::Namespace->new( 'http://xmlns.com/foaf/0.1/' );
$map->add_mapping(foaf => $foaf);
$map->add_mapping(rdf => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' );
$map->list_prefixes;  #  ( 'foaf', 'rdf', 'xsd' )
$map->foaf; # Returns URI::Namespace object
while (my ($prefix, $nsURI) = $map->each_map) {
       $node->setNamespace($nsURI->as_string, $prefix); # For use with XML::LibXML
}

DESCRIPTION

This module provides an object to manage multiple namespaces for creating URI::Namespace objects and for serializing.

METHODS

WARNING

Avoid using the names 'can', 'isa', 'VERSION', and 'DOES' as namespace prefix, because these names are defined as method for every Perl object by default. The method names 'new' and 'uri' are also forbidden. Names of methods of Moose::Object must also be avoided.

Using them will result in an error.

AUTHORS

Chris Prather, <chris@prather.org> Kjetil Kjernsmo, <kjetilk@cpan.org> Gregory Todd Williams, <gwilliams@cpan.org> Toby Inkster, <tobyink@cpan.org>

CONTRIBUTORS

Dorian Taylor Paul Williams

BUGS

Please report any bugs using github

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc URI::NamespaceMap

COPYRIGHT & LICENSE

Copyright 2012,2013,2014,2015,2016,2017,2018,2019 Gregory Todd Williams, Chris Prather and Kjetil Kjernsmo

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.