home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / Namespace.pod < prev    next >
Encoding:
Text File  |  2003-08-22  |  2.4 KB  |  133 lines

  1. =head1 NAME
  2.  
  3. XML::LibXML::Namespace - XML::LibXML Namespace Implementation
  4.  
  5. =head1 SYNOPSIS
  6.  
  7.   my $ns = XML::LibXML::Namespace->new($nsURI);
  8.   print $ns->getName()
  9.   print $ns->name()
  10.   print $ns->prefix()
  11.   $localname = $ns->getLocalName()
  12.   print $ns->getData()
  13.   print $ns->getValue()
  14.   print $ns->value()
  15.   print $ns->uri()
  16.   $known_uri = $ns->getNamespaceURI()
  17.   $known_prefix = $ns->getPredix()
  18.  
  19.  
  20. =head1 DESCRIPTION
  21.  
  22. Namespace nodes are returned by both $element->findnodes('namespace::foo') or
  23. by $node->getNamespaces().
  24.  
  25. The namespace node API is not part of any current DOM API, and so it is quite
  26. minimal. It should be noted that namespace nodes are not a sub class of
  27. XML::LibXML::Node, however Namespace nodes act a lot like attribute nodes, and
  28. similarly named methods will return what you would expect if you treated the
  29. namespace node as an attribute.
  30.  
  31. =over 4
  32.  
  33. =item B<new>
  34.  
  35.   my $ns = XML::LibXML::Namespace->new($nsURI);
  36.  
  37. Creates a new Namespace node. Note that this is not a 'node' as an attribute or
  38. an element node. Therefore you can't do call all XML::LibXML::Node Functions.
  39. All functions available for this node are listed below.
  40.  
  41. optionally you can pass the prefix to the namespace constructor. If this second
  42. parameter is ommited you will create a so called default namespace. Note, the
  43. newly created namespace is not bound to any docuement or node, therefore you
  44. should not expect it to be available in an existing document.
  45.  
  46.  
  47. =item B<getName>
  48.  
  49.   print $ns->getName()
  50.  
  51. Returns "xmlns:prefix", where prefix is the prefix for this namespace.
  52.  
  53.  
  54. =item B<name>
  55.  
  56.   print $ns->name()
  57.  
  58. Alias for getName()
  59.  
  60.  
  61. =item B<prefix>
  62.  
  63.   print $ns->prefix()
  64.  
  65. Returns the prefix bound to this namespace declaration.
  66.  
  67.  
  68. =item B<getLocalName>
  69.  
  70.   $localname = $ns->getLocalName()
  71.  
  72. Alias for prefix()
  73.  
  74.  
  75. =item B<getData>
  76.  
  77.   print $ns->getData()
  78.  
  79. Returns the URI of the namespace.
  80.  
  81.  
  82. =item B<getValue>
  83.  
  84.   print $ns->getValue()
  85.  
  86. Alias for getData()
  87.  
  88.  
  89. =item B<value>
  90.  
  91.   print $ns->value()
  92.  
  93. Alias for getData()
  94.  
  95.  
  96. =item B<uri>
  97.  
  98.   print $ns->uri()
  99.  
  100. Alias for getData()
  101.  
  102.  
  103. =item B<getNamespaceURI>
  104.  
  105.   $known_uri = $ns->getNamespaceURI()
  106.  
  107. Returns the string "http://www.w3.org/2000/xmlns/"
  108.  
  109.  
  110. =item B<getPrefix>
  111.  
  112.   $known_prefix = $ns->getPredix()
  113.  
  114. Returns the string "xmlns"
  115.  
  116.  
  117.  
  118. =back
  119.  
  120. =head1 AUTHORS
  121.  
  122. Matt Sergeant, 
  123. Christian Glahn, 
  124. =head1 VERSION
  125.  
  126. 1.56
  127.  
  128. =head1 COPYRIGHT
  129.  
  130. 2001-2002, AxKit.com Ltd; 2001-2003 Christian Glahn, All rights reserved.
  131.  
  132. =cut
  133.