File: Util.pm

package info (click to toggle)
movabletype-opensource 5.1.4%2Bdfsg-4%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 32,996 kB
  • sloc: perl: 197,285; php: 62,405; sh: 166; xml: 117; makefile: 83; sql: 32
file content (52 lines) | stat: -rw-r--r-- 934 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package XML::Elemental::Util;
use strict;

use Exporter;
@XML::Elemental::Util::ISA = qw( Exporter );
use vars qw( @EXPORT_OK );
@EXPORT_OK = qw( process_name );

sub process_name {
    $_[0] =~ m/^{(.*)}(.+)$/;
    my $ns = defined $1 ? $1 : '';
    $2, $ns;
}

#--- more to come?

1;

__END__

=begin

=head1 NAME

XML::Elemental::Util - utility methods for working with
L<XML::Elemental>.

=head1 METHODS

All utility methods are exportable.

=over

=item process_name($name)

Takes one required string presumed to be in Clarkian
notation and parses it into its local name and namespace URI
parts. If the element name does not have a namespace
provided a null string is returned. An element must always
have a local part, however if undefined is returned the name
was not a in the proper notation.

=back

=head1 AUTHOR & COPYRIGHT

Please see the XML::Elemental manpage for author, copyright,
and license information.

=cut

=end