diff options
author | Marek Safar <marek.safar@gmail.com> | 2012-05-31 14:24:26 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2012-05-31 14:25:24 +0400 |
commit | 7b3f562eabac201f1bd73d34e026ba358d54d6f9 (patch) | |
tree | 81d0b7d34c3682247697150e03278e606a78aaa1 /mcs | |
parent | 5b0b2ec8ed3311f1a34256b7fc28b05026cce4aa (diff) |
A fix for failing xml writer tests
Diffstat (limited to 'mcs')
3 files changed, 6 insertions, 6 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs index 8abbfeb9e65..287dbe7856f 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextWriter2.cs @@ -219,7 +219,7 @@ namespace Mono.Xml XmlDeclState xmldecl_state = XmlDeclState.Allow; bool check_character_validity; - NewLineHandling newline_handling = NewLineHandling.None; + NewLineHandling newline_handling = NewLineHandling.Replace; bool is_document_entity; WriteState state = WriteState.Start; @@ -332,7 +332,7 @@ namespace Mono.Xml new char [] {'&', '<', '>'}; escaped_attr_chars = newline_handling != NewLineHandling.None ? - new char [] {'"', '&', '<', '>', '\r', '\n', '\t'} : + v2 ? new char [] {'"', '&', '<', '>', '\r', '\n', '\t'} : new char [] {'"', '&', '<', '>', '\r', '\n' } : new char [] {'"', '&', '<', '>' }; } @@ -1457,7 +1457,7 @@ namespace Mono.Xml goto case '&'; continue; case '\t': - if(isAttribute + if(isAttribute && v2 && newline_handling != NewLineHandling.None) { if (start < i) WriteCheckedBuffer (text, start, i - start); diff --git a/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs b/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs index 7d8fa4f2749..086dcdcf93c 100644 --- a/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs +++ b/mcs/class/System.XML/System.Xml/XmlWriterSettings.cs @@ -81,7 +81,7 @@ namespace System.Xml // LAMESPEC: MS.NET says it is "\r\n", but it is silly decision. newLineChars = Environment.NewLine; newLineOnAttributes = false; - newLineHandling = NewLineHandling.None; + newLineHandling = NewLineHandling.Replace; omitXmlDeclaration = false; outputMethod = XmlOutputMethod.AutoDetect; } diff --git a/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs b/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs index 5049500052f..65ee4bc3e69 100644 --- a/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorTests.cs @@ -608,8 +608,8 @@ namespace MonoTests.System.Xml XPathNavigator nav = doc.CreateNavigator (); XPathNodeIterator iter = nav.Select ("/Abc/Foo"); iter.MoveNext (); - Assert.AreEqual ("Hello<\r\nInnerXml", iter.Current.InnerXml, "#1"); - Assert.AreEqual ("<Foo>Hello<\r\nInnerXml</Foo>", iter.Current.OuterXml, "#2"); + Assert.AreEqual ("Hello<" + Environment.NewLine + "InnerXml", iter.Current.InnerXml, "#1"); + Assert.AreEqual ("<Foo>Hello<" + Environment.NewLine + "InnerXml</Foo>", iter.Current.OuterXml, "#2"); iter = nav.Select ("/Abc/Foo/text()"); iter.MoveNext (); Assert.AreEqual (String.Empty, iter.Current.InnerXml, "#3"); |