TXFANode.SetAttribute Method

procedure SetAttribute(const N, AValue: AnsiString);

Assigns an attribute on the node, replacing an existing case-sensitive name or appending a new attribute

N and AValue contain UTF-8 bytes, matching the node's XML names and text; the method converts to the compiler's string-list representation and preserves BMP characters, supplementary characters, and leading or trailing whitespace when saving and reloading XDP

An empty AValue creates or retains a present attribute with an empty value, serialized as name=""; use RemoveAttribute to delete the attribute

HasAttr distinguishes a present empty attribute from an absent attribute; AttrValue returns an empty string in either case

Replacing a value preserves the attribute's position and node identity; repeating the same assignment does not add duplicate attributes or mark an unchanged packet as modified

An empty N raises EHPDFXFAError before changing the node

The owning TXFAPacketDOM enforces its attribute-count and attribute-byte limits when serializing; empty attributes count toward both limits

Attribute-byte limits count the serialized UTF-8 name, separator, and value bytes, including all bytes of a supplementary character

TXFANode Class ยท XFA Packet DOM