xmlbase(3am)

πŸ“¦ version 1.1.2, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ xmlbase(3am) ✨

okay bestie, gather round πŸ’– this is xmlbase from the GNU Awk Extension Modules (section 3am, obviously, we're fancy like that), and it's here to add some basic functionality to gawk-xml. it's giving "small library, big slay" energy, no cap.


🌸 NAME 🌸

xmlbase β€” adds some basic functionality to gawk-xml. that's it, that's the vibe. short king of a name, iconic behaviour. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

@include "xmlbase"

result = XmlEscape(str)
result = XmlEscapeQuote(str)

XmlWriteError(message)
XmlCheckError()

look at her. four little functions and one @include. literally all you need to get started, bestie. ✨


πŸ’… DESCRIPTION πŸ’…

the xmlbase awk library adds some basic facilities to the gawk-xml extension. think of it as the glow-up kit for your XML-in-awk adventures πŸ¦‹

🌈 Automatic error reporting

the xmlbase library contains a rule that automatically invokes XmlCheckError() at ENDFILE. so like… it just does the thing for you. no asking, no begging, she simply shows up. 🫢

πŸ”₯ XmlEscape(str)

returns the string argument with the basic XML metacharacters (<, >, &) replaced by their predefined XML escape sequences. three characters getting escorted out of the function, respectfully. πŸ’…

🌸 XmlEscapeQuote(str)

returns the string argument with all the XML metacharacters (<, >, &, ", ') replaced by their predefined XML escape sequences. that's right, she brought two extra friends β€” the quotes got invited to the party too. πŸŽ‰

⭐ XmlWriteError(message)

prints a formatted diagnostic message showing FILENAME, XMLROW, XMLCOL, XMLLEN and the string argument. it's the full tea β˜• β€” filename, row, column, length, and your message, all laid out. no crumbs left behind.

πŸ’€ XmlCheckError()

if either XMLERROR or ERRNO have a non-null value, invokes XmlWriteError() on it. XMLERROR takes precedence over ERRNO β€” like, XMLERROR is the main character and ERRNO knows it. 😭 if ERRNO is used then it is cleared, to avoid duplicated error reports. so she's tidy too. obsessed. ✨


🧚 NOTES 🧚

the xmlbase library automatically loads the xml gawk extension. you don't have to do anything, she's already got her own ride to the function party. πŸš—πŸ’¨


πŸ™ˆ BUGS πŸ™ˆ

the error reporting facility may not suit everybody. ngl, that's just the truth of it β€” some people want their errors a different flavour, and that's valid. 🫢


πŸ’œ AUTHOR πŸ’œ

Manuel Collado, m-collado@users.sourceforge.net. thank you for your service king πŸ«‘πŸ‘‘


πŸ” SEE ALSO πŸ”

the whole friend group, fr fr. go say hi to the rest of the squad. 🌈


πŸ‘‘ COPYING PERMISSIONS πŸ‘‘

Copyright (C) 2017, Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of this manual page provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual page under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.

πŸ’– legal bestie said what legal bestie said β€” we keep the receipts, we respect the copyright, periodt.

okay that's the whole page πŸŽ€ this came from the GAWK Extension Library (gawkex…) and it's dated January 2017 β€” so she's been serving looks for a minute now and honestly? she still ate. πŸ’…βœ¨ bye bestie, go escape some XML πŸ¦‹

πŸ“¦ where this page comes from