Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
Fixed an issue where the xml declaration tag would not get generated …
Browse files Browse the repository at this point in the history
…in most of the tests.

Signed-off-by: Kevin Thompson <mrunleaded@gmail.com>
  • Loading branch information
Kevin Thompson authored and alexkay committed Jan 18, 2012
1 parent 0ce32b4 commit 4915e5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializer.cs
Expand Up @@ -156,7 +156,8 @@ public byte[] GetBytes<TObject> (TObject obj, XmlSerializationOptions<TContext>

using (var stream = new MemoryStream ()) {
using (var writer = XmlWriter.Create (stream, new XmlWriterSettings {
Encoding = serializationOptions.Encoding ?? Helper.UTF8Unsigned, OmitXmlDeclaration = true, })) {
Encoding = serializationOptions.Encoding ?? Helper.UTF8Unsigned,
OmitXmlDeclaration = serializationOptions.XmlDeclarationType == XmlDeclarationType.None})) {
WriteXmlDeclaration (writer, serializationOptions);
SerializeCore (obj, writer, serializationOptions.Context);
}
Expand Down

0 comments on commit 4915e5b

Please sign in to comment.