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

XmlElement::SetAttributeNode(SharedPtr<XmlAttribute>) method

添加指定的 XmlAttribute

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

ReturnValue

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

另见

XmlElement::SetAttributeNode(String, String) method

添加指定的 XmlAttribute

virtual SharedPtr<XmlAttribute> System::Xml::XmlElement::SetAttributeNode(String localName, String namespaceURI)
参数类型描述
localNameString属性的本地名称。
namespaceURIString属性的命名空间 URI。

ReturnValue

要添加的 XmlAttribute

另见