XML::XP...ttribute(3)

✨ NAME ✨

XML::XPath::Attribute β€” a single attribute πŸ’…

okay so bestie, this is from the User Contributed Perl Documentation collection, and it's genuinely one of the cutest little classes you'll ever meet. It's literally just... one attribute. One. A single attribute. That's the whole vibe. A key, a value, maybe a prefix and a namespace if it's feeling fancy πŸŽ€


🌸 API 🌸

πŸ’– new ( key, value, prefix )

Create a new attribute node. That's it, that's the constructor, she's simple and she knows it ✨

πŸ’– getName

Returns the key for the attribute. The name. The identifier. The whole point 🫢

πŸ’– getLocalName

As getName above, but without namespace information β€” so it's giving "just the local part, thanks" πŸ’…

πŸ’– getNodeValue / getData

Returns the value. Two names, same energy, both slay 🌈

πŸ’– setNodeValue

Sets the value of the attribute node. Now you're the one in charge, main character energy fr fr πŸ‘‘

πŸ’– getPrefix

Returns the prefix. The little namespace-y bit at the front πŸŽ€

πŸ’– getNamespace

Return the namespace. Yes bestie, the whole namespace. Iconic 🌟

πŸ’– toString

Generates key="value", encoded correctly. No cap β€” the encoding is handled, you don't have to worry about it πŸ’œ


okay that's literally the whole page, she's a short one but she ate πŸ’€

perl v5.42.1 Β· 2026-04-21 β€” mwah, that's the version and the date this lil doc was born, and it lives in the XML::XPath::Attribute(3) corner of the manual universe. go forth and attribute responsibly πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from