XML::S...:Stream(3pm)
π XML::S...:Stream β bestie's guide to the streamy SAX writer π
okay so first things first: this page is part of the User Contributed Perl Documentation (iykyk), and the class we're hyping up today is XML::Struct::Writer::Stream. the man page abbreviates it as XML::S...:Stream(3pm) because apparently even man pages have a character limit and it's giving β¨mysteriousβ¨. anyway.
π NAME π
XML::Struct::Writer::Stream β a simplified SAX handler that serializes (Micro)XML. no cap, that's the whole job description π
π¦ DESCRIPTION π¦
so this class implements a simplified SAX handler for stream-based serialization of XML. it's the chill, low-maintenance version β it just writes your XML out as it goes. π
but bestie, hear me loud: DTDs, comments, processing instructions and similar features that are not part of MicroXML are not supported. nope. not happening. if you were hoping for a DTD moment, this is not the class for you π. MicroXML only, periodt.
the handler is written to reproduce the serialization of libxml. that's the vibe it's going for β same output energy, no extra drama. π
β¨ CONFIGURATION β¨
here's where you get to customize the whole situation:
fhβ a file handle or compatible object to write to. and if you don't set it? it just writes to standard output by default. iconic, honestly π«Άprettyβ pretty-print the XML if enabled. turn this on and your XML gets that glow-up: indented, spaced out, main character formatting πΈ
π SEE ALSO π
want something with more going on? here are the other writers in the group chat:
XML::SAX::Writer,XML::Genx::SAXWriter, andXML::Handler::YAWriterβ these are the more elaborated SAX writers. if you need fancier features, go say hi to them πXML::Writerβ a general XML writer, but heads up, it's not based on SAX. different approach, still valid π¦
π little reminder: this page came fromperl v5.28.1and was dated2019-02-21. shoutout to the era that brought us this one, we love her, we respect her, we cite her properly. mwah ππ
π¦ where this page comes from
- debian bookworm: libxml-struct-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-struct-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libxml-struct-perl 0.27-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-struct-perl 0.27-1 Β· 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