Cet article a fait l’objet d’une traduction automatique. Pour afficher l’article en anglais, activez la case d’option Anglais. Vous pouvez également afficher le texte anglais dans une fenêtre contextuelle en faisant glisser le pointeur de la souris sur le texte traduit.
Traduction
Anglais

XmlWriter.Create méthode

 

Date de publication : novembre 2016

Crée une instance XmlWriter.

Espace de noms:   System.Xml
Assembly:  System.Xml (dans System.Xml.dll)

NomDescription
System_CAPS_pubmethodSystem_CAPS_staticCreate(Stream)

Crée un nouveau XmlWriter instance à l’aide du flux spécifié.

System_CAPS_pubmethodSystem_CAPS_staticCreate(Stream, XmlWriterSettings)

Crée un nouveau XmlWriter instance à l’aide du flux et XmlWriterSettings objet.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String)

Crée un nouveau XmlWriter instance à l’aide du nom de fichier spécifié.

System_CAPS_pubmethodSystem_CAPS_staticCreate(String, XmlWriterSettings)

Crée un XmlWriter à l’aide du nom de fichier d’instance et XmlWriterSettings objet.

System_CAPS_pubmethodSystem_CAPS_staticCreate(StringBuilder)

Crée un nouveau XmlWriter instance à l’aide du StringBuilder.

System_CAPS_pubmethodSystem_CAPS_staticCreate(StringBuilder, XmlWriterSettings)

Crée un XmlWriter à l’aide de l’instance du StringBuilder et XmlWriterSettings objets.

System_CAPS_pubmethodSystem_CAPS_staticCreate(TextWriter)

Crée un nouveau XmlWriter instance à l’aide du TextWriter.

System_CAPS_pubmethodSystem_CAPS_staticCreate(TextWriter, XmlWriterSettings)

Crée un XmlWriter à l’aide de l’instance du TextWriter et XmlWriterSettings objets.

System_CAPS_pubmethodSystem_CAPS_staticCreate(XmlWriter)

Crée un XmlWriter à l’aide de l’élément spécifié de l’instance XmlWriter objet.

System_CAPS_pubmethodSystem_CAPS_staticCreate(XmlWriter, XmlWriterSettings)

Crée un XmlWriter à l’aide de l’élément spécifié de l’instance XmlWriter et XmlWriterSettings objets.

Some of the Overload:System.Xml.XmlWriter.Create overloads include a settings parameter that accepts an T:System.Xml.XmlWriterSettings object. You can use this object to:

  • Specify which features you want supported on the created T:System.Xml.XmlWriter object.

  • Reuse the T:System.Xml.XmlWriterSettings object to create multiple writer objects. The T:System.Xml.XmlWriterSettings object is copied and marked read-only for each created writer. Changes to the settings on an T:System.Xml.XmlWriterSettings instance do not affect existing writers with the same settings. Thus, you can use the same settings to create multiple writers with the same functionality. Or, you can modify the settings on an T:System.Xml.XmlWriterSettings instance and create a new writer with a different set of features.

  • Add features to an existing XML writer. The Overload:System.Xml.XmlWriter.Create method can accept another T:System.Xml.XmlWriter object. The underlying T:System.Xml.XmlWriter object does not have to be an XML writer created by the static Overload:System.Xml.XmlWriter.Create method. For example, you can specify a user-defined XML writer to add additional features to.

  • Take full advantage of features such as better conformance checking and compliance to the XML 1.0 recommendationhttp://www.w3.org/TR/2006/REC-xml-20060816/ that are available only on T:System.Xml.XmlWriter objects created by the static Overload:System.Xml.XmlWriter.Create method.

If you use a Overload:System.Xml.XmlWriter.Create overload that doesn't accept an T:System.Xml.XmlWriterSettings object, the following default writer settings are used:

Setting

Default

CheckCharacters

true

CloseOutput

false

ConformanceLevel

ConformanceLevel.Document

Encoding

Encoding.UTF8

Indent

false

IndentChars

Two spaces

NamespaceHandling

Default (no removal)

NewLineChars

\r\n (carriage return, new line)

NewLineHandling

NewLineHandling.Replace

NewLineOnAttributes

false

OmitXmlDeclaration

false

OutputMethod

XmlOutputMethod.Xml

WriteEndDocumentOnClose

true

System_CAPS_noteRemarque

Although the .NET Framework includes the T:System.Xml.XmlTextWriter class, which is a concrete implementation of the T:System.Xml.XmlWriter class, we recommend that you create T:System.Xml.XmlWriter instances by using the Overload:System.Xml.XmlWriter.Create method.

Retour au début
Afficher: