XML::G...PerlSAX(3pm)

πŸ“¦
version 0.46alpha Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 events
  • DocumentHandler β€” the handler that receives document events
  • Source β€” 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 🌟


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