XML::S...:Stream(3pm)

πŸ“¦
version 0.27 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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, and XML::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 from perl v5.28.1 and was dated 2019-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