XNamespace.Xml 속성

정의

XML URI(http://www.w3.org/XML/1998/namespace)에 해당하는 XNamespace 개체를 가져옵니다.

public:
 static property System::Xml::Linq::XNamespace ^ Xml { System::Xml::Linq::XNamespace ^ get(); };
public static System.Xml.Linq.XNamespace Xml { get; }
static member Xml : System.Xml.Linq.XNamespace
Public Shared ReadOnly Property Xml As XNamespace

속성 값

XNamespace XML URI(http://www.w3.org/XML/1998/namespace)에 해당하는 입니다.

예제

다음 예제에서는 XML 트리에서 특성을 만드는 xml:space="preserve" 방법을 보여줍니다.

XElement root = new XElement("Root",
    new XAttribute(XNamespace.Xml + "space", "preserve"),
    new XElement("Child", "content")
);
Console.WriteLine(root);
Dim root As XElement = _
    <Root xml:space="preserve">
        <Child>content</Child>
    </Root>
Console.WriteLine(root)

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

<Root xml:space="preserve">
  <Child>content</Child>
</Root>

설명

와 같은 space특정 표준화된 특성은 네임스페이스에 http://www.w3.org/XML/1998/namespace 있습니다. W3C 표준은 이 네임스페이스를 XML 트리의 특성으로 선언할 필요가 없도록 지정합니다. XML 파서에서 항상 자동으로 사용할 수 있는 예약된 네임스페이스입니다.

적용 대상

추가 정보