xmlcopy(3am)

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

πŸ’– xmlcopy β€” bestie edition πŸ’–

okay so this is xmlcopy(3am) from the GNU Awk Extension Modules manual, and honestly? she's giving token reconstruction and I'm obsessed. 🫢


✨ NAME ✨

xmlcopy β€” adds token reconstruction facilities to gawk-xml. like, it lets you rebuild the current XML token from scratch. no cap. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

@include "xmlcopy"

result = XmlToken()
XmlCopy()

XmlSetAttribute(name, value)
XmlIgnoreAttribute(name)

🌸 DESCRIPTION 🌸

The xmlcopy awk library adds the ability to reconstruct the current XML token. and the plot twist? πŸ¦‹ the token can be modified before reconstruction. so you're not just copying, you're editing. main character energy fr fr.

πŸ”₯ Token reconstruction πŸ”₯

  • XmlToken() β€” Returns an XML string that represents the current token. it's rebuilt from the predefined variables XMLEVENT, XMLNAME, XMLATTR and $0. and those can either have the original current token values or values you changed yourself. so it's your world, bestie. πŸ’œ
  • XmlCopy() β€” Writes an XML string that represents the current token, exactly as returned by XmlToken(). it's literally XmlToken() but it does the writing for you. iconic behaviour.

🌈 Token modification 🌈

  • XmlSetAttribute(name, value) β€” Adds or replaces the (name, value) entry in XMLATTR. Also adds name to $0 if it's not already in there. two jobs, one function, slay. πŸ’…
  • XmlIgnoreAttribute(name) β€” Removes name from $0, so XmlToken() will ignore it. Keeps XMLATTR unchanged.. (yes the original has two dots, we respect the punctuation, periodt ✨)

πŸ“ NOTES πŸ“

The xmlcopy library includes the xmlbase library. Its functionality is implicitly available. so you get the whole bundle, no extra charge. 🎁


πŸ’€ BUGS πŸ’€

When an XML declaration is reconstructed, the advertised encoding may not match the actual encoding. 😭 so like… the vibe check might fail. just know that going in, bestie.


πŸ‘‘ SEE ALSO πŸ‘‘

go read the whole friend group, they're all iconic. 🌟


🧚 AUTHOR 🧚

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


⭐ 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.

like yes, you can copy it, translate it, remix it β€” just keep the receipts (the copyright notice and permission notice) and don't be weird about it. πŸ’œ

and that's the whole page, bestie!! this was GAWK Extension Library (gawkex…) energy, dated January 2017, and yeah β€” it's still xmlcopy(3am) and she ate. πŸŽ€βœ¨πŸ¦‹ bye!! πŸ’…

πŸ“¦ where this page comes from