XmlArrayItemAttribute.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 요소의 네임스페이스입니다.

예제

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

public ref class Transportation
{
public:

   // Sets the Namespace property.

   [XmlArrayItem(Car::typeid,Namespace="http://www.cpandl.com")]
   array<Vehicle^>^MyVehicles;
};
public class Transportation
{
   // Sets the Namespace property.
   [XmlArrayItem(typeof(Car), Namespace = "http://www.cpandl.com")]
   public Vehicle[] MyVehicles;
}
Public Class Transportation
    ' Sets the Namespace property.
    <XmlArrayItem(GetType(Car), Namespace := "http://www.cpandl.com")> _
    Public MyVehicles() As Vehicle
End Class

설명

이 속성은 Namespace XML의 World Wide Web 컨소시엄 사양 네임스페이스를 따릅니다.

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

적용 대상