XElement.RemoveAttributes 메서드

정의

XElement의 특성을 제거합니다.

public:
 void RemoveAttributes();
public void RemoveAttributes ();
member this.RemoveAttributes : unit -> unit
Public Sub RemoveAttributes ()

예제

다음 예제에서는 특성 및 자식 요소를 사용하여 요소를 만듭니다. 그런 다음 이 메서드를 호출하여 특성을 제거합니다. 자식 요소는 그대로 유지됩니다.

XElement root = new XElement("Root",  
    new XAttribute("Att1", 1),  
    new XAttribute("Att2", 2),  
    new XAttribute("Att3", 3),  
    new XElement("Child1", 1),  
    new XElement("Child2", 2),  
    new XElement("Child3", 3)  
);  
root.RemoveAttributes();  
Console.WriteLine(root);  
Dim root As XElement = _   
    <Root Attr1="1" Attr2="2" Attr3="3">  
        <Child1>1</Child1>  
        <Child2>2</Child2>  
        <Child3>3</Child3>  
     </Root>  

root.RemoveAttributes()  
Console.WriteLine(root)  

이 예제는 다음과 같은 출력을 생성합니다.

<Root>  
  <Child1>1</Child1>  
  <Child2>2</Child2>  
  <Child3>3</Child3>  
</Root>   

설명

이 메서드는 이벤트와 이벤트를 발생 Changed 합니다 Changing .

적용 대상

추가 정보