System.Xml.XmlUtf8RawTextWriter.WriteXmlDeclaration C# (CSharp) Méthode

WriteXmlDeclaration() private méthode

private WriteXmlDeclaration ( XmlStandalone standalone ) : void
standalone XmlStandalone
Résultat void
        internal override void WriteXmlDeclaration( XmlStandalone standalone ) {
            // Output xml declaration only if user allows it and it was not already output
            if ( !omitXmlDeclaration && !autoXmlDeclaration ) {

                

                RawText( "<?xml version=\"" );

                // Version
                RawText( "1.0" );

                // Encoding
                if ( encoding != null ) {
                    RawText( "\" encoding=\"" );
                    RawText( ( encoding.CodePage == 1201 ) ? "UTF-16BE" : encoding.WebName );
                }

                // Standalone
                if ( standalone != XmlStandalone.Omit ) {
                    RawText( "\" standalone=\"" );
                    RawText( standalone == XmlStandalone.Yes ? "yes" : "no" );
                }

                RawText( "\"?>" );
            }
        }

Same methods

XmlUtf8RawTextWriter::WriteXmlDeclaration ( string xmldecl ) : void