Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / i486-linux-gnu-thread-multi / XML / LibXML / Namespace.pod
CommitLineData
3fea05b9 1=head1 NAME
2
3XML::LibXML::Namespace - XML::LibXML Namespace Implementation
4
5=head1 SYNOPSIS
6
7
8
9 use XML::LibXML;
10 # Only methods specific to Namespace nodes are listed here,
11 # see XML::LibXML::Node manpage for other methods
12
13 my $ns = XML::LibXML::Namespace->new($nsURI);
14 print $ns->nodeName();
15 print $ns->name();
16 $localname = $ns->getLocalName();
17 print $ns->getData();
18 print $ns->getValue();
19 print $ns->value();
20 $known_uri = $ns->getNamespaceURI();
21 $known_prefix = $ns->getPrefix();
22
23=head1 DESCRIPTION
24
25Namespace nodes are returned by both $element->findnodes('namespace::foo') or
26by $node->getNamespaces().
27
28The namespace node API is not part of any current DOM API, and so it is quite
29minimal. It should be noted that namespace nodes are I<<<<<< not >>>>>> a sub class of L<<<<<< XML::LibXML::Node >>>>>>, however Namespace nodes act a lot like attribute nodes, and similarly named
30methods will return what you would expect if you treated the namespace node as
31an attribute. Note that in order to fix several inconsistencies between the API
32and the documentation, the behavior of some functions have been changed in
331.64.
34
35
36=head1 METHODS
37
38=over 4
39
40=item new
41
42 my $ns = XML::LibXML::Namespace->new($nsURI);
43
44Creates a new Namespace node. Note that this is not a 'node' as an attribute or
45an element node. Therefore you can't do call all L<<<<<< XML::LibXML::Node >>>>>> Functions. All functions available for this node are listed below.
46
47Optionally you can pass the prefix to the namespace constructor. If this second
48parameter is omitted you will create a so called default namespace. Note, the
49newly created namespace is not bound to any document or node, therefore you
50should not expect it to be available in an existing document.
51
52
53=item declaredURI
54
55Returns the URI for this namespace.
56
57
58=item declaredPrefix
59
60Returns the prefix for this namespace.
61
62
63=item nodeName
64
65 print $ns->nodeName();
66
67Returns "xmlns:prefix", where prefix is the prefix for this namespace.
68
69
70=item name
71
72 print $ns->name();
73
74Alias for nodeName()
75
76
77=item getLocalName
78
79 $localname = $ns->getLocalName();
80
81Returns the local name of this node as if it were an attribute, that is, the
82prefix associated with the namespace.
83
84
85=item getData
86
87 print $ns->getData();
88
89Returns the URI of the namespace, i.e. the value of this node as if it were an
90attribute.
91
92
93=item getValue
94
95 print $ns->getValue();
96
97Alias for getData()
98
99
100=item value
101
102 print $ns->value();
103
104Alias for getData()
105
106
107=item getNamespaceURI
108
109 $known_uri = $ns->getNamespaceURI();
110
111Returns the string "http://www.w3.org/2000/xmlns/"
112
113
114=item getPrefix
115
116 $known_prefix = $ns->getPrefix();
117
118Returns the string "xmlns"
119
120
121
122=back
123
124=head1 AUTHORS
125
126Matt Sergeant,
127Christian Glahn,
128Petr Pajas
129
130
131=head1 VERSION
132
1331.70
134
135=head1 COPYRIGHT
136
1372001-2007, AxKit.com Ltd.
138
1392002-2006, Christian Glahn.
140
1412006-2009, Petr Pajas.
142
143=cut