DomDocument.createAttribute

DomAttribute * createAttribute(scope const(char)[] lowerName, scope const(char)[] value, Ns ns = Ns.None) @nogc nothrow pure @safe

A new attribute (not attached). The name must be lowercase.

DomAttribute * createAttribute(uint id, scope const(char)[] value, Ns ns = Ns.None) @nogc nothrow pure @safe

ditto