XML::G...PerlSAX(3pm)
π NAME π
XML::Grove::PerlSAX β bestie, it's a PerlSAX event interface for XML objects. That's the whole vibe. β¨
π SYNOPSIS π
okay so here's the tea, literally just:
use XML::Grove::PerlSAX;
$parser = XML::Grove::PerlSAX->new( [OPTIONS] );
$result = $parser->parse( [OPTIONS] );
# or
$result = $xml_object->parse( [OPTIONS] );
see? not scary. three lines and you're iconic. π
π¦ DESCRIPTION π¦
So XML::Grove::PerlSAX is a PerlSAX parser that takes your XML::Grove objects and goes pew pew generating PerlSAX events out of them. it's giving translator energy. π§
This man page is the lowdown on the specific options, handlers, and properties that XML::Grove::PerlSAX supports. For the general how-do-I-even-use-PerlSAX stuff, go read the PerlSAX standard in "PerlSAX.pod". iykyk. π
πΈ METHODS πΈ
newβ creates a brand new parser object, periodt. The default options for parsing (they're described down below, keep reading bestie) get passed in as key-value pairs or as one single hash. You can also just change options directly on the parser object whenever you want, unless it says otherwise. And any options you hand to"parse()"? They override the default options sitting in the parser object, but only for as long as that parse is running. temporary queen behavior. πparseβ parses a document. Options (again, described below) get passed as key-value pairs or as a single hash. Options passed to"parse()"override the default options in the parser object. no cap. π₯
β¨ OPTIONS β¨
Here's everything XML::Grove::PerlSAX supports, bestie:
Handlerβ the default handler that receives eventsDocumentHandlerβ the handler that receives document eventsSourceβ a hash containing the input source for parsing
If you don't give it any handlers at all, every single event just gets silently ignored. like, it's not gonna yell at you. it's just gonna move on. π
If you pass a single grove argument to the "parse()" method, it gets treated as if you'd given it a "Source" option with a "Grove" parameter. sneaky but valid. π«Ά
The "Source" hash may contain the following parameters:
Groveβ The grove object used to generate parse events..
(yes, the double period is canon, i don't make the rules π)
π HANDLERS π
These are the events that XML::Grove::PerlSAX generates. It passes the corresponding grove object as its parameter, so the properties that get passed to the handler are the ones that were used to create the grove, or were assigned to it. Want the full list of properties that were provided? Go check the docs for the parser you used to create the grove. π
π DocumentHandler methods π
start_documentβ get notified that a document is beginning. This one is called from the XML::Grove::Document object before it processes any document content. it's the opening number. π¬end_documentβ get notified that a document is ending. Called from the XML::Grove::Document object after it processes all document content. curtain call. πstart_elementβ get notified that an element is beginning. Called from the XML::Grove::Element object before it processes any element content. βend_elementβ get notified that an element is ending. Called from the XML::Grove::Element object after it processes all element content. πcharactersβ get notified about character data. This one is called from the XML::Grove::Characters object. π¬processing_instructionβ get notified about a processing instruction. Called from the XML::Grove::PI object. π§commentβ get notified about a comment. Called from the XML::Grove::Comment object. π
π AUTHOR π
Ken MacLeod, ken@bitsko.slc.ut.us β iconic, we stan. π«Ά
π SEE ALSO π
perl(1),XML::Grove(3)- Extensible Markup Language (XML) <http://www.w3c.org/XML>
and that's the whole page bestie, no notes. this was brought to you by perl v5.36.0, dated 2022-11-29, from the User Contributed Perl Documentation β slay, go parse something gorgeous π β¨πΈ
π¦ where this page comes from
- debian bookworm: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-grove-perl 0.46alpha-14 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms