.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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 "POE::Filter::XML::Handler 3pm" .TH POE::Filter::XML::Handler 3pm "2022-06-17" "perl v5.34.0" "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" POE::Filter::XML::Handler \- Default SAX Handler for POE::Filter::XML .SH "VERSION" .IX Header "VERSION" version 1.140700 .SH "DESCRIPTION" .IX Header "DESCRIPTION" POE::Filter::XML::Handler is the default \s-1SAX\s0 handler for POE::Filter::XML. It extends XML::SAX::Base to provide different semantics for streaming vs. non-streaming contexts. This handle by default builds POE::Filter::XML::Nodes. .SH "PUBLIC_ATTRIBUTES" .IX Header "PUBLIC_ATTRIBUTES" .SS "not_streaming" .IX Subsection "not_streaming" .Vb 1 \& is: ro, isa: Bool, default: false .Ve .PP not_streaming determines the behavior for the opening tag parsed. If what is being parsed is not a stream, the document will be parsed in full then placed into the finished_nodes attribute. Otherwise, the opening tag will be placed immediately into the finished_nodes bucket. .SH "PRIVATE_ATTRIBUTES" .IX Header "PRIVATE_ATTRIBUTES" .SS "current_node" .IX Subsection "current_node" .Vb 1 \& is: rw, isa: POE::Filter::XML::Node .Ve .PP current_node holds the node being immediately parsed. .SS "finished_nodes" .IX Subsection "finished_nodes" .Vb 1 \& is: ro, isa: ArrayRef, traits: Array .Ve .PP finished_nodes holds the nodes that have been completely parsed. Access to this attribute is provided through the following methods: .PP .Vb 7 \& handles => \& { \& all_finished_nodes => \*(Aqelements\*(Aq, \& has_finished_nodes => \*(Aqcount\*(Aq, \& add_finished_node => \*(Aqpush\*(Aq, \& get_finished_node => \*(Aqshift\*(Aq, \& } .Ve .SS "depth_stack" .IX Subsection "depth_stack" .Vb 1 \& is: ro, isa: ArrayRef, traits: Array .Ve .PP depth_stack holds the operating stack for the parsed nodes. As nodes are processed, ancendants of the current node are stored in the stack. When done they are popped off the stack. Access to this attribute is provided through the following methods: .PP .Vb 6 \& handles => \& { \& push_depth_stack => \*(Aqpush\*(Aq, \& pop_depth_stack => \*(Aqpop\*(Aq, \& depth => \*(Aqcount\*(Aq, \& } .Ve .SH "PUBLIC_METHODS" .IX Header "PUBLIC_METHODS" .SS "reset" .IX Subsection "reset" reset will clear the current node, the finished nodes, and the depth stack. .SH "PROTECTED_METHODS" .IX Header "PROTECTED_METHODS" .SS "override start_element" .IX Subsection "override start_element" .Vb 1 \& (HashRef $data) .Ve .PP start_element is overridden from the XML::SAX::Base class to provide our custom behavior for dealing with streaming vs. non-streaming data. It builds Nodes then attaches them to either the root node (non-streaming) or as stand-alone top level fragments (streaming) sets them to the current node. Children nodes are appended to their parents before getting set as the current node. Then the base class method is called via \fBsuper()\fR .SS "override end_element" .IX Subsection "override end_element" .Vb 1 \& (HashRef $data) .Ve .PP end_element is overridden from the XML::SAX::Base class to provide our custom behavior for dealing with streaming vs. non-streaming data. Mostly this method is in charge of stack management when the depth of the stack reaches certain points. In streaming documents, this means that top level fragments (not root) are popped off the stack and added to the finished_nodes collection. Otherwise a Node is created with stream_end set and added to the finished nodes. .PP Then the base class method is called via \fBsuper()\fR .SS "override characters" .IX Subsection "override characters" .Vb 1 \& (HashRef $data) .Ve .PP characters merely applies the character data as text to the current node being processed. It then calls the base class method via \fBsuper()\fR. .SH "AUTHOR" .IX Header "AUTHOR" Nicholas R. Perez .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2014 by Nicholas R. Perez . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.