XML::Li...:Builder(3)

✨ NAME ✨

okay so bestie, welcome to XML::LibXML::SAX::Builder β€” the lil icon that does Building DOM trees from SAX events. that's it, that's the whole job description πŸ’…

(this is section 3 of the User Contributed Perl Documentation, if u were wondering where u wandered into πŸŽ€)


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste girlie:

use XML::LibXML::SAX::Builder;
my $builder = XML::LibXML::SAX::Builder->new();

my $gen = XML::Generator::DBI->new(Handler => $builder, dbh => $dbh);
$gen->execute("SELECT * FROM Users");

my $doc = $builder->result();

see how chill that is? new builder, hand it to a generator, run the thing, grab ur doc. no cap πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

so basically, this is a SAX handler that generates a DOM tree from SAX events. usage is literally exactly like the synopsis above, nothing sneaky. input is accepted from any SAX1 or SAX2 event generator. any. we don't discriminate 🫢

building DOM trees from SAX events is lowkey super easy with XML::LibXML::SAX::Builder. the class is designed as a SAX2 final handler β€” not as a filter! like, she's the end of the line, the main character, the one who finishes the job. she is not passing the aux cord to anyone else πŸ’€

and here's the thing bestie, since SAX is strictly stream oriented, you should not expect anything to return from a generator. nope. nothing comes back out of it, that's just not how streams work. instead u have to ask the builder instance <em>directly</em> to get the document built. that's the whole plot twist ✨

XML::LibXML::SAX::Builder's result() function holds the document generated from the last SAX stream. last one. so don't go running three streams and then wondering which doc u got, because it's the most recent one, periodt πŸ‘‘


πŸŽ€ AUTHORS πŸŽ€

the legends behind the vibes:

  • Matt Sergeant
  • Christian Glahn
  • Petr Pajas

⭐ VERSION ⭐

2.0213 β€” yeah that's the number, write it down πŸ“


the receipts, in order:

  • 2001-2007, AxKit.com Ltd.
  • 2002-2006, Christian Glahn.
  • 2006-2009, Petr Pajas.

πŸ‘‘ LICENSE πŸ‘‘

this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

slay. go forth and redistribute responsibly, bestie πŸ’œ


okay and one last thing, the lil sign-off at the bottom of the page says this is from perl v5.42.2 and it's dated 2026-05-25, and the whole thing lives under XML::LibXML::SAX::Builder(3). that's a wrap, ily, bye 🧚🌸

πŸ“¦ where this page comes from