XML-CommonNS-0.06/0000755000076500001210000000000010565224403016115 5ustar perigrinappserveradm00000000000000XML-CommonNS-0.06/Build.PL0000444000076500001210000000072610565224403017414 0ustar perigrinappserveradm00000000000000use strict; use warnings; use Module::Build; my $builder = Module::Build->new( module_name => 'XML::CommonNS', license => 'perl', dist_author => 'Chris Prather ', dist_version_from => 'lib/XML/CommonNS.pm', requires => { 'XML::NamespaceFactory' => 0, 'Test::More' => 0, 'version' => 0, }, add_to_cleanup => [ 'XML-CommonNS-*' ], ); $builder->create_build_script(); XML-CommonNS-0.06/Changes0000444000076500001210000000075110565224403017411 0ustar perigrinappserveradm00000000000000XML::CommonNS 0.06 2007-02-15 - change from creating exported variables at compile time, to when they're actually requested, which could be compile time 0.05 2007-02-13 - fix pre-reqs in the dist 0.04 2007-02-12 - updated packaging to clean up the dist - added a uri() method at kasei's request 0.03 2007-01-17 - added FOAF, RSS1, DC_TERMS, COMMENT, SYN, and REL as seen in RDF::Helper::Constant 0.02 ??? 0.01 2003-06-29 16:46:34 - original version XML-CommonNS-0.06/lib/0000755000076500001210000000000010565224403016663 5ustar perigrinappserveradm00000000000000XML-CommonNS-0.06/lib/XML/0000755000076500001210000000000010565224403017323 5ustar perigrinappserveradm00000000000000XML-CommonNS-0.06/lib/XML/CommonNS.pm0000444000076500001210000001273110565224403021354 0ustar perigrinappserveradm00000000000000package XML::CommonNS; use strict; use warnings; use XML::NamespaceFactory qw(); use Exporter; use vars qw($VERSION %NS @ISA @EXPORT_OK); $VERSION = '0.06'; @ISA = qw(Exporter); sub BEGIN { %NS = ( XML => 'http://www.w3.org/XML/1998/namespace', XMLNS => 'http://www.w3.org/2000/xmlns/', XLINK => 'http://www.w3.org/1999/xlink', SVG => 'http://www.w3.org/2000/svg', XHTML => 'http://www.w3.org/1999/xhtml', XHTML2 => 'http://www.w3.org/2002/06/xhtml2', XFORMS => 'http://www.w3.org/2002/xforms/cr', XMLEVENTS => 'http://www.w3.org/2001/xml-events', DC => 'http://purl.org/dc/elements/1.1/', DC_TERMS => 'http://purl.org/dc/terms/', RDF => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', RDFS => 'http://www.w3.org/2000/01/rdf-schema#', OWL => 'http://www.w3.org/2002/07/owl#', FOAF => 'http://xmlns.com/foaf/0.1/', REL => 'http://purl.org/vocab/relationship/', RSS1 => 'http://purl.org/rss/1.0/', COMMENTS => 'http://purl.org/net/rssmodules/blogcomments/', SYN => 'http://purl.org/rss/1.0/modules/syndication/', RNG => 'http://relaxng.org/ns/structure/1.0', XSD => 'http://www.w3.org/2001/XMLSchema', XSI => 'http://www.w3.org/2001/XMLSchema-instance', MATHML => 'http://www.w3.org/1998/Math/MathML', XSLT => 'http://www.w3.org/1999/XSL/Transform', XSLFO => 'http://www.w3.org/1999/XSL/Format', SOAPENC11 => 'http://schemas.xmlsoap.org/soap/encoding/', SOAPENV11 => 'http://schemas.xmlsoap.org/soap/envelope/', SOAPENC12 => 'http://www.w3.org/2003/05/soap-encoding', SOAPENV12 => 'http://www.w3.org/2003/05/soap-envelope', WSDL11 => 'http://schemas.xmlsoap.org/wsdl/', WSDL12 => 'http://www.w3.org/2003/06/wsdl', ); while (my ($k, $v) = each %NS) { push @EXPORT_OK, '$' . $k; } } sub import { my $class = shift; my $pkg = caller; my @opt = @_; no strict 'refs'; @opt = keys %NS if $opt[0] eq ':all'; for my $exp (@opt) { die "No namespace available for key $exp" unless exists $NS{$exp}; __PACKAGE__->uri($exp); __PACKAGE__->export_to_level( 1, $class, '$' . $exp ); } return 1; } sub uri { my ($self, $exp) = @_; no strict 'refs'; unless (defined ${__PACKAGE__ . "::$exp"} ) { ${__PACKAGE__ . "::$exp"} = XML::NamespaceFactory->new($NS{$exp}); } return ${__PACKAGE__ . "::$exp"}; } 1; =pod =head1 NAME XML::CommonNS - A list of commonly used namespaces =head1 SYNOPSIS # import $RDF, $RDFS, $OWL, $DC use XML::CommonNS qw(RDF RDFS OWL DC); my %CONFIG = ( Namespaces => { rdf => "$RDF", rdfs => "$RDFS", owl => "$OWL", foaf => "$FOAF", }, ExpandQNames => 1, ); # or the uri() method my $foaf = XML::CommonNS->uri('FOAF'); =head1 DESCRIPTION All you need do to use this module is import the namespaces you want from the list below. All of those will then become available to you. They are XML::NamespaceFactory object and can thus be used both as simple strings and as XML::NamespaceFactory objects. See XML::NamespaceFactory for how that may help you. I hesitated for a while before releasing this module. As a directory of namespaces that can't (and almost certainly shouldn't) be exhaustive, it implies editorial decisions and I wasn't certain it was CPAN worthy. However, after getting really tired of tracking down namespaces in every single small XML muning script I made, I wrote it for myself. After a while using it, I don't see why others wouldn't find it useful as well. =head1 NAMESPACES The currently available namespaces are listed below. Should you consider one worthy of addition (it needs to be common enough) please simply notify me. Those marked with a start are subject to change. I WILL change them when the corresponding specification changes. XML http://www.w3.org/XML/1998/namespace XMLNS http://www.w3.org/2000/xmlns/ XLINK http://www.w3.org/1999/xlink SVG http://www.w3.org/2000/svg XHTML http://www.w3.org/1999/xhtml XHTML2 http://www.w3.org/2002/06/xhtml2 XFORMS http://www.w3.org/2002/xforms/cr XMLEVENTS http://www.w3.org/2001/xml-events DC http://purl.org/dc/elements/1.1/ DC_TERMS http://purl.org/dc/terms/ RDF http://www.w3.org/1999/02/22-rdf-syntax-ns# RDFS http://www.w3.org/2000/01/rdf-schema# OWL http://www.w3.org/2002/07/owl# FOAF http://xmlns.com/foaf/0.1/ REL http://purl.org/vocab/relationship/ RSS1 http://purl.org/rss/1.0/ COMMENTS http://purl.org/net/rssmodules/blogcomments/ SYN http://purl.org/rss/1.0/modules/syndication/ RNG http://relaxng.org/ns/structure/1.0 XSD http://www.w3.org/2001/XMLSchema XSI http://www.w3.org/2001/XMLSchema-instance MATHML http://www.w3.org/1998/Math/MathML XSLT http://www.w3.org/1999/XSL/Transform XSLFO http://www.w3.org/1999/XSL/Format SOAPENC11 http://schemas.xmlsoap.org/soap/encoding/ SOAPENV11 http://schemas.xmlsoap.org/soap/envelope/ SOAPENC12 http://www.w3.org/2003/05/soap-encoding SOAPENV12 http://www.w3.org/2003/05/soap-envelope WSDL11 http://schemas.xmlsoap.org/wsdl/ WSDL12 http://www.w3.org/2003/06/wsdl =head1 METHODS =over =item uri Allows you to directly retrieve one of the URI objects without doing the import() dance. =back =head1 AUTHOR Chris Prather, Echris@prather.orgE Robin Berjon, Erobin.berjon@expway.frE =head1 COPYRIGHT AND LICENSE Copyright 2003 by Robin Berjon This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut XML-CommonNS-0.06/Makefile.PL0000444000076500001210000000104710565224403020067 0ustar perigrinappserveradm00000000000000use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'XML::CommonNS', AUTHOR => 'Chris Prather ', VERSION_FROM => 'lib/XML/CommonNS.pm', ABSTRACT_FROM => 'lib/XML/CommonNS.pm', PL_FILES => {}, PREREQ_PM => { 'XML::NamespaceFactory' => 0, 'Test::More' => 0, 'version' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'XML-CommonNS-*' }, ); XML-CommonNS-0.06/MANIFEST0000444000076500001210000000020510565224403017241 0ustar perigrinappserveradm00000000000000Build.PL Changes MANIFEST META.yml # Will be created by "make dist" Makefile.PL README lib/XML/CommonNS.pm t/00.load.t t/05-basics.t XML-CommonNS-0.06/META.yml0000444000076500001210000000072510565224403017370 0ustar perigrinappserveradm00000000000000--- name: XML-CommonNS version: 0.06 author: - 'Chris Prather ' abstract: A list of commonly used namespaces license: perl resources: license: http://dev.perl.org/licenses/ requires: Test::More: 0 XML::NamespaceFactory: 0 version: 0 provides: XML::CommonNS: file: lib/XML/CommonNS.pm version: 0.06 generated_by: Module::Build version 0.2805 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html version: 1.2 XML-CommonNS-0.06/README0000444000076500001210000000060710565224403016776 0ustar perigrinappserveradm00000000000000XML::CommonNS ============= A list of commonly used namespaces, with XML::NamespaceFactory intergration. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install COPYRIGHT AND LICENCE Copyright (C) 2003 Robin Berjon This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. XML-CommonNS-0.06/t/0000755000076500001210000000000010565224403016360 5ustar perigrinappserveradm00000000000000XML-CommonNS-0.06/t/00.load.t0000444000076500001210000000017310565224403017701 0ustar perigrinappserveradm00000000000000use Test::More tests => 1; BEGIN { use_ok( 'XML::CommonNS' ); } diag( "Testing XML::CommonNS $XML::CommonNS::VERSION" ); XML-CommonNS-0.06/t/05-basics.t0000444000076500001210000000060210565224403020227 0ustar perigrinappserveradm00000000000000use Test::More; use strict; BEGIN { plan tests => 6 }; use XML::CommonNS qw(SVG XHTML2 RNG); ok(1); is( $RNG, "http://relaxng.org/ns/structure/1.0" ); is( $SVG, "http://www.w3.org/2000/svg" ); is( $XHTML2, "http://www.w3.org/2002/06/xhtml2" ); is( $SVG->extensionsDef, "{http://www.w3.org/2000/svg}extensionsDef" ); is(XML::CommonNS->uri('FOAF'), 'http://xmlns.com/foaf/0.1/');