WriteAttributeString()

XmlWriter::WriteAttributeString(const String&, const String&, const String&) method

When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value.

void System::Xml::XmlWriter::WriteAttributeString(const String &localName, const String &ns, const String &value)

Arguments

ParameterTypeDescription
localNameconst String&The local name of the attribute.
nsconst String&The namespace URI to associate with the attribute.
valueconst String&The value of the attribute.

Exceptions

ExceptionDescription
InvalidOperationExceptionThe state of writer is not WriteState::Element or writer is closed.
ArgumentExceptionThe xml:space or xml:lang attribute value is invalid.

XmlWriter::WriteAttributeString(const String&, const String&) method

When overridden in a derived class, writes out the attribute with the specified local name and value.

void System::Xml::XmlWriter::WriteAttributeString(const String &localName, const String &value)

Arguments

ParameterTypeDescription
localNameconst String&The local name of the attribute.
valueconst String&The value of the attribute.

Exceptions

ExceptionDescription
InvalidOperationExceptionThe state of writer is not WriteState::Element or writer is closed.
ArgumentExceptionThe xml:space or xml:lang attribute value is invalid.

XmlWriter::WriteAttributeString(const String&, const String&, const String&, const String&) method

When overridden in a derived class, writes out the attribute with the specified prefix, local name, namespace URI, and value.

void System::Xml::XmlWriter::WriteAttributeString(const String &prefix, const String &localName, const String &ns, const String &value)

Arguments

ParameterTypeDescription
prefixconst String&The namespace prefix of the attribute.
localNameconst String&The local name of the attribute.
nsconst String&The namespace URI of the attribute.
valueconst String&The value of the attribute.

Exceptions

ExceptionDescription
InvalidOperationExceptionThe state of writer is not WriteState::Element or writer is closed.
ArgumentExceptionThe xml:space or xml:lang attribute value is invalid.
XmlExceptionThe localName or ns is nullptr.

See Also