summaryrefslogtreecommitdiff
path: root/mcs/class/System.XML
diff options
context:
space:
mode:
authorJo Shields <directhex@apebox.org>2014-02-19 22:12:43 +0000
committerJo Shields <directhex@apebox.org>2014-02-19 22:12:43 +0000
commit9972bf87b4f27d9c8f358ef8414ac1ab957a2f0f (patch)
tree5bb230c1d698659115f918e243c1d4b0aa4c7f51 /mcs/class/System.XML
parentd0a215f5626219ff7927f576588a777e5331c7be (diff)
downloadmono-upstream/3.2.8+dfsg.tar.gz
Imported Upstream version 3.2.8+dfsgupstream/3.2.8+dfsg
Diffstat (limited to 'mcs/class/System.XML')
-rwxr-xr-x[-rw-r--r--]mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs2
-rwxr-xr-x[-rw-r--r--]mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs10
-rw-r--r--mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs5
3 files changed, 12 insertions, 5 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs b/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs
index 43f0a75d09..c6a85fbea4 100644..100755
--- a/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs
+++ b/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs
@@ -125,7 +125,7 @@ namespace Mono.Xml.Schema
schemas,
nsResolver,
options);
- if (reader.BaseURI != String.Empty)
+ if (reader.BaseURI != String.Empty && Uri.IsWellFormedUriString(reader.BaseURI, UriKind.Absolute))
v.SourceUri = new Uri (reader.BaseURI);
readerLineInfo = reader as IXmlLineInfo;
diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
index 6f7ec34a5d..081f2c76d4 100644..100755
--- a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaValidatorTests.cs
@@ -441,6 +441,16 @@ namespace MonoTests.System.Xml
}
}
}
+
+ [Test]
+ public void IgnoresInvalidBaseUri ()
+ {
+ var source = new StringReader (@"<?xml version='1.0' encoding='utf-8'?><Test></Test>");
+ var readerSettings = new XmlReaderSettings { ValidationType = ValidationType.Schema };
+ var reader = XmlReader.Create (source, readerSettings, "invalidBaseUri");
+
+ Assert.IsNotNull (reader);
+ }
}
}
diff --git a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs
index e27b8db60f..4be97a8140 100644
--- a/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs
+++ b/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializationWriterTests.cs
@@ -13,7 +13,6 @@
//
using System;
-using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Xml;
@@ -1546,7 +1545,6 @@ namespace MonoTests.System.XmlSerialization
}
-#if NET_2_0
[Test]
public void TestFromEnum_Null_TypeName ()
{
@@ -1566,7 +1564,6 @@ namespace MonoTests.System.XmlSerialization
Assert.IsTrue (ex.Message.IndexOf ("AnInvalidValue") != -1, "#4");
Assert.IsTrue (ex.Message.IndexOf ("SomeType") != -1, "#5");
}
-#endif
[Test]
public void WriteCharacter ()
@@ -1581,7 +1578,7 @@ namespace MonoTests.System.XmlSerialization
[Serializable]
public class ToBeSerialized
{
- [DefaultValue ('a')]
+ [global::System.ComponentModel.DefaultValue ('a')]
public char character = '\'';
}