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 / PI.pod < prev    next >
Encoding:
Text File  |  2003-08-22  |  1.9 KB  |  71 lines

  1. =head1 NAME
  2.  
  3. XML::LibXML::PI - XML::LibXML Processing Instructions
  4.  
  5. =head1 SYNOPSIS
  6.  
  7.   $pinode->setData( $data_string );
  8.   $pinode->setData( name=>string_value [...] );
  9.  
  10.  
  11. =head1 DESCRIPTION
  12.  
  13. Processing instructions are implemented with XML::LibXML with read and write
  14. access. The PI data is the PI without the PI target (as specified in XML 1.0
  15. [17]) as a string. This string can be accessed with getData as implemented in
  16. XML::LibXML::Node.
  17.  
  18. The write access is aware about the fact, that many processing instructions
  19. have attribute like data. Therefore setData() provides besides the DOM spec
  20. conform Interface to pass a set of named parameter. So the code segment
  21.  
  22.   my $pi = $dom->createProcessingInstruction("abc");
  23.   $pi->setData(foo=>'bar', foobar=>'foobar');
  24.   $dom->appendChild( $pi );
  25.  
  26. will result the following PI in the DOM:
  27.  
  28.   <?abc foo="bar" foobar="foobar"?>
  29.  
  30. Which is how it is specified in the DOM specification. This three step
  31. interface creates temporary a node in perl space. This can be avoided while
  32. using the insertProcessingInstruction() method. Instead of the three calls
  33. described above, the call
  34.  
  35.   $dom->insertProcessingInstruction("abc",'foo="bar" foobar="foobar"');
  36.  
  37. will have the same result as above.
  38.  
  39. XML::LibXML::PI's implementation of setData() differs a bit from the the
  40. standard version as available in XML::LibXML::Node():
  41.  
  42. =over 4
  43.  
  44. =item B<setData>
  45.  
  46.   $pinode->setData( $data_string );
  47.   $pinode->setData( name=>string_value [...] );
  48.  
  49. This method allows to change the content data of a PI. Additionaly to the
  50. interface specified for DOM Level2, the method provides a named parameter
  51. interface to set the data. This parameterlist is converted into a string before
  52. it is appended to the PI.
  53.  
  54.  
  55.  
  56. =back
  57.  
  58. =head1 AUTHORS
  59.  
  60. Matt Sergeant, 
  61. Christian Glahn, 
  62. =head1 VERSION
  63.  
  64. 1.56
  65.  
  66. =head1 COPYRIGHT
  67.  
  68. 2001-2002, AxKit.com Ltd; 2001-2003 Christian Glahn, All rights reserved.
  69.  
  70. =cut
  71.