xmlcopy(3am)
π 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 variablesXMLEVENT,XMLNAME,XMLATTRand$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 byXmlToken(). it's literallyXmlToken()but it does the writing for you. iconic behaviour.
π Token modification π
XmlSetAttribute(name, value)β Adds or replaces the(name, value)entry inXMLATTR. Also addsnameto$0if it's not already in there. two jobs, one function, slay. πXmlIgnoreAttribute(name)β Removesnamefrom$0, soXmlToken()will ignore it. KeepsXMLATTRunchanged.. (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 π
- XML Processing With gawk
xmlbase(3am)xmltree(3am)xmlsimple(3am)xmlwrite(3am)
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
- fedora 43: gawk-xml 1.1.2-2.fc43 Β· GPL-1.0-or-later AND GPL-3.0-or-later
- fedora 44: gawk-xml 1.1.2-3.fc44 Β· GPL-1.0-or-later AND GPL-3.0-or-later
- nixos 26.05: gawkextlib-xml-unstable 2022-10-20
- nixpkgs unstable: gawkextlib-xml-unstable 2022-10-20
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms