1XML::Stream::Node(3)  User Contributed Perl Documentation XML::Stream::Node(3)
2
3
4

NAME

6       XML::Stream::Node - Functions to make building and parsing the tree
7       easier to work with.
8

SYNOPSIS

10         Just a collection of functions that do not need to be in memory if you
11       choose one of the other methods of data storage.
12
13         This creates a hierarchy of Perl objects and provides various methods
14       to manipulate the structure of the tree.  It is much like the C library
15       libxml.
16

FORMAT

18       The result of parsing:
19
20         <foo><head id="a">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo>
21
22       would be:
23
24         [ tag:       foo
25           att:       {}
26           children:  [ tag:      head
27                        att:      {id=>"a"}
28                        children: [ tag:      "__xmlstream__:node:cdata"
29                                    children: "Hello "
30                                  ]
31                                  [ tag:      em
32                                    children: [ tag:      "__xmlstream__:node:cdata"
33                                                children: "there"
34                                              ]
35                                  ]
36                      ]
37                      [ tag:      bar
38                        children: [ tag:      "__xmlstream__:node:cdata"
39                                    children: "Howdy "
40                                  ]
41                                  [ tag:      ref
42                                  ]
43                      ]
44                      [ tag:      "__xmlstream__:node:cdata"
45                        children: "do"
46                      ]
47         ]
48

METHODS

50         new()          - creates a new node.  If you specify tag, then the root
51         new(tag)         tag is set.  If you specify data, then cdata is added
52         new(tag,cdata)   to the node as well.  Returns the created node.
53
54         get_tag() - returns the root tag of the node.
55
56         set_tag(tag) - set the root tag of the node to tag.
57
58         add_child(node)      - adds the specified node as a child to the current
59         add_child(tag)         node, or creates a new node with the specified tag
60         add_child(tag,cdata)   as the root node.  Returns the node added.
61
62         remove_child(node) - removes the child node from the current node.
63
64         remove_cdata() - removes all of the cdata children from the current node.
65
66         add_cdata(string) - adds the string as cdata onto the current nodes
67                             child list.
68
69         get_cdata() - returns all of the cdata children concatenated together
70                       into one string.
71
72         get_attrib(attrib) - returns the value of the attrib if it is valid,
73                              or returns undef is attrib is not a real
74                              attribute.
75
76         put_attrib(hash) - for each key/value pair specified, create an
77                            attribute in the node.
78
79         remove_attrib(attrib) - remove the specified attribute from the node.
80
81         add_raw_xml(string,[string,...]) - directly add a string into the XML
82                                            packet as the last child, with no
83                                            translation.
84
85         get_raw_xml() - return all of the XML in a single string, undef if there
86                         is no raw XML to include.
87
88         remove_raw_xml() - remove all raw XML strings.
89
90         children() - return all of the children of the node in a list.
91
92         attrib() - returns a hash containing all of the attributes on this
93                    node.
94
95         copy() - return a recursive copy of the node.
96
97         XPath(path) - run XML::Stream::XPath on this node.
98
99         XPathCheck(path) - run XML::Stream::XPath on this node and return 1 or 0
100                            to see if it matches or not.
101
102         GetXML() - return the node in XML string form.
103

AUTHOR

105       By Ryan Eatmon in June 2002 for http://jabber.org/
106
107       Currently maintained by Darian Anthony Patrick.
108
110       Copyright (C) 1998-2004 Jabber Software Foundation http://jabber.org/
111
112       This module licensed under the LGPL, version 2.1.
113
114
115
116perl v5.30.0                      2019-07-26              XML::Stream::Node(3)
Impressum