XmlRootAttribute.Namespace 속성

정의

XML 루트 요소의 네임스페이스를 가져오거나 설정합니다.

public:
 property System::String ^ Namespace { System::String ^ get(); void set(System::String ^ value); };
public string Namespace { get; set; }
public string? Namespace { get; set; }
member this.Namespace : string with get, set
Public Property Namespace As String

속성 값

String

XML 요소의 네임스페이스입니다.

예제

다음 예제에서는 클래스에 XmlRootAttribute 적용 하 고 속성을 설정 합니다 Namespace .


[XmlRoot(Namespace="http://www.cpandl.com")]
public ref class Group{};
[XmlRoot(Namespace = "http://www.cpandl.com")]
public class Group
{
   // Insert the members of the Group class.
}
<XmlRoot(Namespace := "http://www.cpandl.com")> _
Public Class Group
    ' Insert the members of the Group class.
End Class

설명

이 속성은 Namespace XML에서 네임스페이스라는 World Wide Web 컨소시엄 사양을 준수합니다.

XML 문서에서 접두사 네임스페이스를 만들려면 모든 접두사 네임스페이스 쌍이 포함된 개체를 만듭니 XmlSerializerNamespaces 다. 각각 XmlArrayAttribute 에 대해 설정한 네임스페이스는 개체에 XmlSerializerNamespaces 포함되어야 합니다. XmlSerializer 문서를 생성할 때 각 배열 항목의 요소 이름 접두사로 올바르게 접두사로 지정됩니다.

적용 대상

추가 정보