XmlNamedNodeMap.RemoveNamedItem Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belirtilen düğümü içinden XmlNamedNodeMapkaldırır.
Aşırı Yüklemeler
| RemoveNamedItem(String) |
düğümünden |
| RemoveNamedItem(String, String) |
eşleşen LocalName ve NamespaceURIile bir düğümü kaldırır. |
RemoveNamedItem(String)
düğümünden XmlNamedNodeMapkaldırır.
public:
virtual System::Xml::XmlNode ^ RemoveNamedItem(System::String ^ name);
public virtual System.Xml.XmlNode RemoveNamedItem (string name);
public virtual System.Xml.XmlNode? RemoveNamedItem (string name);
abstract member RemoveNamedItem : string -> System.Xml.XmlNode
override this.RemoveNamedItem : string -> System.Xml.XmlNode
Public Overridable Function RemoveNamedItem (name As String) As XmlNode
Parametreler
Döndürülenler
XmlNode öğesinden XmlNamedNodeMap kaldırıldı veya null eşleşen bir düğüm bulunamadı.
Örnekler
Aşağıdaki örnek, özniteliği kaldırmak için sınıfını (öğesinden XmlNamedNodeMapdevralır) kullanırXmlAttributeCollection.
#using <System.Xml.dll>
using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
XmlDocument^ doc = gcnew XmlDocument;
doc->LoadXml( "<book genre='novel' publicationdate='1997'> <title>Pride And Prejudice</title></book>" );
XmlAttributeCollection^ attrColl = doc->DocumentElement->Attributes;
// Remove the publicationdate attribute.
attrColl->RemoveNamedItem( "publicationdate" );
Console::WriteLine( "Display the modified XML..." );
Console::WriteLine( doc->OuterXml );
}
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book genre='novel' publicationdate='1997'> " +
" <title>Pride And Prejudice</title>" +
"</book>");
XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;
// Remove the publicationdate attribute.
attrColl.RemoveNamedItem("publicationdate");
Console.WriteLine("Display the modified XML...");
Console.WriteLine(doc.OuterXml);
}
}
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.LoadXml("<book genre='novel' publicationdate='1997'> " & _
" <title>Pride And Prejudice</title>" & _
"</book>")
Dim attrColl as XmlAttributeCollection = doc.DocumentElement.Attributes
' Remove the publicationdate attribute.
attrColl.RemoveNamedItem("publicationdate")
Console.WriteLine("Display the modified XML...")
Console.WriteLine(doc.OuterXml)
end sub
end class
Şunlara uygulanır
RemoveNamedItem(String, String)
eşleşen LocalName ve NamespaceURIile bir düğümü kaldırır.
public:
virtual System::Xml::XmlNode ^ RemoveNamedItem(System::String ^ localName, System::String ^ namespaceURI);
public virtual System.Xml.XmlNode RemoveNamedItem (string localName, string namespaceURI);
public virtual System.Xml.XmlNode? RemoveNamedItem (string localName, string? namespaceURI);
abstract member RemoveNamedItem : string * string -> System.Xml.XmlNode
override this.RemoveNamedItem : string * string -> System.Xml.XmlNode
Public Overridable Function RemoveNamedItem (localName As String, namespaceURI As String) As XmlNode
Parametreler
- localName
- String
Kaldırılacak düğümün yerel adı.
- namespaceURI
- String
Kaldırılacak düğümün ad alanı URI'si.
Döndürülenler
Kaldırılan XmlNode veya null eşleşen bir düğüm bulunamadı.