XNamespace.Xml Propriedade
Definição
Obtém o objeto XNamespace correspondente ao URI do XML (http://www.w3.org/XML/1998/namespace).Gets the XNamespace object that corresponds to the XML URI (http://www.w3.org/XML/1998/namespace).
public:
static property System::Xml::Linq::XNamespace ^ Xml { System::Xml::Linq::XNamespace ^ get(); };
public static System.Xml.Linq.XNamespace Xml { get; }
member this.Xml : System.Xml.Linq.XNamespace
Public Shared ReadOnly Property Xml As XNamespace
Valor da propriedade
O XNamespace que corresponde ao URI do XML ( http://www.w3.org/XML/1998/namespace ).The XNamespace that corresponds to the XML URI (http://www.w3.org/XML/1998/namespace).
Exemplos
O exemplo a seguir mostra como criar um xml:space="preserve" atributo em uma árvore XML:The following example shows how to create an xml:space="preserve" attribute in an XML tree:
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)
Esse exemplo gera a saída a seguir:This example produces the following output:
<Root xml:space="preserve">
<Child>content</Child>
</Root>
Comentários
Determinados atributos padronizados, como space , estão no http://www.w3.org/XML/1998/namespace namespace.Certain standardized attributes, such as space, are in the http://www.w3.org/XML/1998/namespace namespace. O padrão W3C especifica que esse namespace não precisa ser declarado como um atributo na árvore XML.The W3C standard specifies that this namespace does not have to be declared as an attribute in the XML tree. É um namespace reservado que está sempre disponível automaticamente no analisador XML.It is a reserved namespace that is always automatically available in the XML parser.