.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML::LibXML::Namespace 3pm" .TH XML::LibXML::Namespace 3pm "2019-02-13" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XML::LibXML::Namespace \- XML::LibXML Namespace Implementation .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use XML::LibXML; \& # Only methods specific to Namespace nodes are listed here, \& # see the XML::LibXML::Node manpage for other methods \& \& my $ns = XML::LibXML::Namespace\->new($nsURI); \& print $ns\->nodeName(); \& print $ns\->name(); \& $localname = $ns\->getLocalName(); \& print $ns\->getData(); \& print $ns\->getValue(); \& print $ns\->value(); \& $known_uri = $ns\->getNamespaceURI(); \& $known_prefix = $ns\->getPrefix(); \& $key = $ns\->unique_key(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Namespace nodes are returned by both \f(CW$element\fR\->findnodes('namespace::foo') or by \f(CW$node\fR\->\fBgetNamespaces()\fR. .PP The namespace node \s-1API\s0 is not part of any current \s-1DOM API,\s0 and so it is quite minimal. It should be noted that namespace nodes are \fInot\fR a sub class of XML::LibXML::Node, however Namespace nodes act a lot like attribute nodes, and similarly named methods will return what you would expect if you treated the namespace node as an attribute. Note that in order to fix several inconsistencies between the \s-1API\s0 and the documentation, the behavior of some functions have been changed in 1.64. .SH "METHODS" .IX Header "METHODS" .IP "new" 4 .IX Item "new" .Vb 1 \& my $ns = XML::LibXML::Namespace\->new($nsURI); .Ve .Sp Creates a new Namespace node. Note that this is not a 'node' as an attribute or an element node. Therefore you can't do call all XML::LibXML::Node Functions. All functions available for this node are listed below. .Sp Optionally you can pass the prefix to the namespace constructor. If this second parameter is omitted you will create a so called default namespace. Note, the newly created namespace is not bound to any document or node, therefore you should not expect it to be available in an existing document. .IP "declaredURI" 4 .IX Item "declaredURI" Returns the \s-1URI\s0 for this namespace. .IP "declaredPrefix" 4 .IX Item "declaredPrefix" Returns the prefix for this namespace. .IP "nodeName" 4 .IX Item "nodeName" .Vb 1 \& print $ns\->nodeName(); .Ve .Sp Returns \*(L"xmlns:prefix\*(R", where prefix is the prefix for this namespace. .IP "name" 4 .IX Item "name" .Vb 1 \& print $ns\->name(); .Ve .Sp Alias for \fBnodeName()\fR .IP "getLocalName" 4 .IX Item "getLocalName" .Vb 1 \& $localname = $ns\->getLocalName(); .Ve .Sp Returns the local name of this node as if it were an attribute, that is, the prefix associated with the namespace. .IP "getData" 4 .IX Item "getData" .Vb 1 \& print $ns\->getData(); .Ve .Sp Returns the \s-1URI\s0 of the namespace, i.e. the value of this node as if it were an attribute. .IP "getValue" 4 .IX Item "getValue" .Vb 1 \& print $ns\->getValue(); .Ve .Sp Alias for \fBgetData()\fR .IP "value" 4 .IX Item "value" .Vb 1 \& print $ns\->value(); .Ve .Sp Alias for \fBgetData()\fR .IP "getNamespaceURI" 4 .IX Item "getNamespaceURI" .Vb 1 \& $known_uri = $ns\->getNamespaceURI(); .Ve .Sp Returns the string \*(L"http://www.w3.org/2000/xmlns/\*(R" .IP "getPrefix" 4 .IX Item "getPrefix" .Vb 1 \& $known_prefix = $ns\->getPrefix(); .Ve .Sp Returns the string \*(L"xmlns\*(R" .IP "unique_key" 4 .IX Item "unique_key" .Vb 1 \& $key = $ns\->unique_key(); .Ve .Sp This method returns a key guaranteed to be unique for this namespace, and to always be the same value for this namespace. Two namespace objects return the same key if and only if they have the same prefix and the same \s-1URI.\s0 The returned key value is useful as a key in hashes. .SH "AUTHORS" .IX Header "AUTHORS" Matt Sergeant, Christian Glahn, Petr Pajas .SH "VERSION" .IX Header "VERSION" 2.0134 .SH "COPYRIGHT" .IX Header "COPYRIGHT" 2001\-2007, AxKit.com Ltd. .PP 2002\-2006, Christian Glahn. .PP 2006\-2009, Petr Pajas. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.