CreateElement()

XmlDocument::CreateElement(const String&) method

Creates an element with the specified name.

SharedPtr<XmlElement> System::Xml::XmlDocument::CreateElement(const String &name)

Arguments

ParameterTypeDescription
nameconst String&The qualified name of the element. If the name contains a colon then the XmlNode::get_Prefix value reflects the part of the name preceding the colon and the XmlDocument::get_LocalName value reflects the part of the name after the colon. The qualified name cannot include a prefix of xmlns.

Return Value

The new XmlElement.

XmlDocument::CreateElement(const String&, const String&) method

Creates an XmlElement with the qualified name and XmlNode::get_NamespaceURI.

SharedPtr<XmlElement> System::Xml::XmlDocument::CreateElement(const String &qualifiedName, const String &namespaceURI)

Arguments

ParameterTypeDescription
qualifiedNameconst String&The qualified name of the element. If the name contains a colon then the XmlNode::get_Prefix value will reflect the part of the name preceding the colon and the XmlDocument::get_LocalName value will reflect the part of the name after the colon. The qualified name cannot include a prefix of xmlns.
namespaceURIconst String&The namespace URI of the element.

Return Value

The new XmlElement.

XmlDocument::CreateElement(const String&, const String&, const String&) method

Creates an element with the specified XmlNode::get_Prefix, XmlDocument::get_LocalName, and XmlNode::get_NamespaceURI.

virtual SharedPtr<XmlElement> System::Xml::XmlDocument::CreateElement(const String &prefix, const String &localName, const String &namespaceURI)

Arguments

ParameterTypeDescription
prefixconst String&The prefix of the new element (if any). String::Empty and nullptr are equivalent.
localNameconst String&The local name of the new element.
namespaceURIconst String&The namespace URI of the new element (if any). String::Empty and nullptr are equivalent.

Return Value

The new XmlElement.

See Also