1XML::LibXML::PI(3)    User Contributed Perl Documentation   XML::LibXML::PI(3)
2
3
4

NAME

6       XML::LibXML::PI - XML::LibXML Processing Instructions
7

SYNOPSIS

9         use XML::LibXML;
10         # Only methods specific to Processing Instruction nodes are listed here,
11         # see the XML::LibXML::Node manpage for other methods
12
13         $pinode->setData( $data_string );
14         $pinode->setData( name=>string_value [...] );
15

DESCRIPTION

17       Processing instructions are implemented with XML::LibXML with read and
18       write access. The PI data is the PI without the PI target (as specified
19       in XML 1.0 [17]) as a string. This string can be accessed with getData
20       as implemented in XML::LibXML::Node.
21
22       The write access is aware about the fact, that many processing
23       instructions have attribute like data. Therefore setData() provides
24       besides the DOM spec conform Interface to pass a set of named
25       parameter. So the code segment
26
27         my $pi = $dom->createProcessingInstruction("abc");
28         $pi->setData(foo=>'bar', foobar=>'foobar');
29         $dom->appendChild( $pi );
30
31       will result the following PI in the DOM:
32
33         <?abc foo="bar" foobar="foobar"?>
34
35       Which is how it is specified in the DOM specification. This three step
36       interface creates temporary a node in perl space. This can be avoided
37       while using the insertProcessingInstruction() method. Instead of the
38       three calls described above, the call
39
40         $dom->insertProcessingInstruction("abc",'foo="bar" foobar="foobar"');
41
42       will have the same result as above.
43
44       XML::LibXML::PI's implementation of setData() documented below differs
45       a bit from the standard version as available in XML::LibXML::Node:
46
47       setData
48             $pinode->setData( $data_string );
49             $pinode->setData( name=>string_value [...] );
50
51           This method allows one to change the content data of a PI.
52           Additionally to the interface specified for DOM Level2, the method
53           provides a named parameter interface to set the data. This
54           parameter list is converted into a string before it is appended to
55           the PI.
56

AUTHORS

58       Matt Sergeant, Christian Glahn, Petr Pajas
59

VERSION

61       2.0132
62
64       2001-2007, AxKit.com Ltd.
65
66       2002-2006, Christian Glahn.
67
68       2006-2009, Petr Pajas.
69

LICENSE

71       This program is free software; you can redistribute it and/or modify it
72       under the same terms as Perl itself.
73
74
75
76perl v5.26.3                      2017-10-28                XML::LibXML::PI(3)
Impressum