XmlElementAttribute.Namespace Propriedade

Definição

Obtém ou define o namespace atribuído ao elemento XML resultante quando a classe é serializada.Gets or sets the namespace assigned to the XML element that results when the class is serialized.

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

Valor da propriedade

String

O namespace do elemento XML.The namespace of the XML element.

Comentários

A Namespace propriedade está em conformidade com a especificação de World Wide Web Consortium, namespaces em XML.The Namespace property conforms to the World Wide Web Consortium specification, Namespaces in XML.

Para criar namespaces associados a um prefixo, você deve criar um XmlSerializerNamespaces que contenha os namespaces e prefixos usados no documento XML.To create namespaces that are associated with a prefix, you must create an XmlSerializerNamespaces that contains the namespaces and prefixes used in the XML document. À medida que você define o namespace para cada XmlArrayAttribute , ele deve corresponder a um dos namespaces no XmlSerializerNamespaces .As you set the namespace for each XmlArrayAttribute, it must match one of the namespaces in the XmlSerializerNamespaces. Quando o XML é gerado, cada matriz é corretamente prefixada com o prefixo associado ao namespace especificado.When the XML is generated, each array is correctly prefixed with the prefix associated with the specified namespace.

Aplica-se a