Inheritance: XmlTextWriter
Ejemplo n.º 1
0
        // Saves the XML document to the specified TextWriter.
        //
        //Saves out the file with xmldeclaration which has encoding value equal to
        //that of textwriter's encoding
        public virtual void Save(TextWriter writer)
        {
            XmlDOMTextWriter xw = new XmlDOMTextWriter(writer);

            if (preserveWhitespace == false)
            {
                xw.Formatting = Formatting.Indented;
            }
            Save(xw);
        }
Ejemplo n.º 2
0
        //Saves out the to the file with exact content in the XmlDocument.
        public virtual void Save(Stream outStream)
        {
            XmlDOMTextWriter xw = new XmlDOMTextWriter(outStream, TextEncoding);

            if (preserveWhitespace == false)
            {
                xw.Formatting = Formatting.Indented;
            }
            WriteTo(xw);
            xw.Flush();
        }
Ejemplo n.º 3
0
 // Saves the XML document to the specified TextWriter.
 //
 //Saves out the file with xmldeclaration which has encoding value equal to
 //that of textwriter's encoding
 public virtual void Save(TextWriter writer)
 {
     XmlDOMTextWriter xw = new XmlDOMTextWriter(writer);
     if (_preserveWhitespace == false)
         xw.Formatting = Formatting.Indented;
     Save(xw);
 }
Ejemplo n.º 4
0
 //Saves out the to the file with exact content in the XmlDocument.
 public virtual void Save(Stream outStream)
 {
     XmlDOMTextWriter xw = new XmlDOMTextWriter(outStream, TextEncoding);
     if (_preserveWhitespace == false)
         xw.Formatting = Formatting.Indented;
     WriteTo(xw);
     xw.Flush();
 }
 public virtual void Save( string filename ) {
     if ( DocumentElement == null )
         throw new XmlException( Res.Xml_InvalidXmlDocument, Res.GetString( Res.Xdom_NoRootEle ) );
     XmlDOMTextWriter xw = new XmlDOMTextWriter( filename, TextEncoding );
     try {
         if ( preserveWhitespace == false )
             xw.Formatting = Formatting.Indented;
          WriteTo( xw );
          xw.Flush();
     }
     finally {
         xw.Close();
     }
 }
 public virtual void Save(string filename)
 {
     if (this.DocumentElement == null)
     {
         throw new XmlException("Xml_InvalidXmlDocument", Res.GetString("Xdom_NoRootEle"));
     }
     XmlDOMTextWriter w = new XmlDOMTextWriter(filename, this.TextEncoding);
     try
     {
         if (!this.preserveWhitespace)
         {
             w.Formatting = Formatting.Indented;
         }
         this.WriteTo(w);
         w.Flush();
     }
     finally
     {
         w.Close();
     }
 }
 public virtual void Save(TextWriter writer)
 {
     XmlDOMTextWriter w = new XmlDOMTextWriter(writer);
     if (!this.preserveWhitespace)
     {
         w.Formatting = Formatting.Indented;
     }
     this.Save(w);
 }
 public virtual void Save(Stream outStream)
 {
     XmlDOMTextWriter w = new XmlDOMTextWriter(outStream, this.TextEncoding);
     if (!this.preserveWhitespace)
     {
         w.Formatting = Formatting.Indented;
     }
     this.WriteTo(w);
     w.Flush();
 }
Ejemplo n.º 9
0
 private String WriteAttributeContent( String prefix, String localName, String ns, String value, bool bMarkup ) {
     StringWriter sw = new StringWriter();
     XmlDOMTextWriter xw = new XmlDOMTextWriter( sw );
     if ( bMarkup )
         xw.WriteStartAttribute( prefix, localName, ns );
     xw.WriteString( value );
     if ( bMarkup )
         xw.WriteEndAttribute();
     xw.Close();
     return sw.ToString();
 }