System::Xml::XmlElement::SetAttributeNode 方法

XmlElement::SetAttributeNode(SharedPtr<XmlAttribute>) method

添加指定的 XmlAttribute

virtual SharedPtr<XmlAttribute> System::Xml::XmlElement::SetAttributeNode(SharedPtr<XmlAttribute> newAttr)
ParameterType描述
newAttrSharedPtr<XmlAttribute>要添加到此元素属性集合的 XmlAttribute 节点。

ReturnValue

如果该属性替换了同名的现有属性,则返回旧的 XmlAttribute;否则,返回 nullptr

另见

XmlElement::SetAttributeNode(String, String) method

添加指定的 XmlAttribute

virtual SharedPtr<XmlAttribute> System::Xml::XmlElement::SetAttributeNode(String localName, String namespaceURI)
ParameterType描述
localName字符串属性的本地名称。
namespaceURI字符串属性的命名空间 URI。

ReturnValue

要添加的 XmlAttribute

另见