diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-04-10 14:21:18 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-04-10 14:21:18 +0300 |
commit | 7abaea4fc7e7bc3da373dfb37f90b6cb0d6f1c8c (patch) | |
tree | ba2d532aaa34b8d16767313aefe90b6fd9df34f1 /src/System.Private.Xml | |
parent | e0ec44b1174887cc42f55edd461457e2d4216239 (diff) | |
parent | acb44e79ef7dc81817da9cf5f19c9819d0f491d1 (diff) |
Merge remote-tracking branch 'upstream/release/2.1' into 2.1-merge
Diffstat (limited to 'src/System.Private.Xml')
12 files changed, 36 insertions, 78 deletions
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs b/src/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs index 88fc758431..5c81a051bd 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs @@ -693,7 +693,7 @@ namespace System.Xml.Serialization { if (special.TypeDesc.Kind == TypeKind.Node) { - value = Document.CreateTextNode(ReadString()); + value = Document.CreateTextNode(Reader.ReadString()); } else { @@ -706,11 +706,11 @@ namespace System.Xml.Serialization { if (text.Mapping.TypeDesc.CollapseWhitespace) { - value = CollapseWhitespace(ReadString()); + value = CollapseWhitespace(Reader.ReadString()); } else { - value = ReadString(); + value = Reader.ReadString(); } } else @@ -721,7 +721,7 @@ namespace System.Xml.Serialization } else { - value = WritePrimitive(text.Mapping, (state) => ((ReflectionXmlSerializationReader)state).ReadString(), this); + value = WritePrimitive(text.Mapping, (state) => ((ReflectionXmlSerializationReader)state).Reader.ReadString(), this); } } } @@ -1832,7 +1832,7 @@ namespace System.Xml.Serialization Func<object, string> functor = (state) => { var reader = (ReflectionXmlSerializationReader)state; - return reader.CollapseWhitespace(reader.ReadString()); + return reader.CollapseWhitespace(reader.Reader.ReadString()); }; o = WriteEnumMethod(enumMapping, functor, this); ReadEndElement(); diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs index 6d4dc7c57e..b3d3af2471 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs @@ -37,19 +37,6 @@ namespace System.Xml.Serialization /// </devdoc> public XmlSchemaImporter(XmlSchemas schemas, CodeIdentifiers typeIdentifiers) : base(schemas, CodeGenerationOptions.GenerateProperties, new ImportContext(typeIdentifiers, false)) { } - /// <include file='doc\XmlSchemaImporter.uex' path='docs/doc[@for="XmlSchemaImporter.XmlSchemaImporter2"]/*' /> - /// <devdoc> - /// <para>[To be supplied.]</para> - /// </devdoc> - public XmlSchemaImporter(XmlSchemas schemas, CodeIdentifiers typeIdentifiers, CodeGenerationOptions options) : base(schemas, options, new ImportContext(typeIdentifiers, false)) { } - - /// <include file='doc\XmlSchemaImporter.uex' path='docs/doc[@for="XmlSchemaImporter.XmlSchemaImporter3"]/*' /> - /// <devdoc> - /// <para>[To be supplied.]</para> - /// </devdoc> - public XmlSchemaImporter(XmlSchemas schemas, CodeGenerationOptions options, ImportContext context) : base(schemas, options, context) { } - - /// <include file='doc\XmlSchemaImporter.uex' path='docs/doc[@for="XmlSchemaImporter.ImportDerivedTypeMapping"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs index 17a11a2cf5..3e349e4340 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs @@ -1428,40 +1428,6 @@ namespace System.Xml.Serialization Array.Copy(a, b, length); return b; } - // This is copied from Core's XmlReader.ReadString, as it is not exposed in the Contract. - protected virtual string ReadString() - { - if (Reader.ReadState != ReadState.Interactive) - { - return string.Empty; - } - Reader.MoveToElement(); - if (Reader.NodeType == XmlNodeType.Element) - { - if (Reader.IsEmptyElement) - { - return string.Empty; - } - else if (!Reader.Read()) - { - throw new InvalidOperationException(SR.Xml_InvalidOperation); - } - if (Reader.NodeType == XmlNodeType.EndElement) - { - return string.Empty; - } - } - string result = string.Empty; - while (IsTextualNode(Reader.NodeType)) - { - result += Reader.Value; - if (!Reader.Read()) - { - break; - } - } - return result; - } // 0x6018 private static uint s_isTextualNodeBitmap = (1 << (int)XmlNodeType.Text) | (1 << (int)XmlNodeType.CDATA) | (1 << (int)XmlNodeType.Whitespace) | (1 << (int)XmlNodeType.SignificantWhitespace); diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs index 25fdb4df57..d9f998ba0f 100644 --- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs +++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs @@ -807,7 +807,7 @@ namespace System.Xml.Serialization #if !FEATURE_SERIALIZATION_UAPAOT [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] [ResourceExposure(ResourceScope.None)] - public static bool GenerateSerializer(Type[] types, XmlMapping[] mappings, Stream stream) + internal static bool GenerateSerializer(Type[] types, XmlMapping[] mappings, Stream stream) { if (types == null || types.Length == 0) return false; diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs index 2a747d6e2a..783692d486 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs @@ -328,9 +328,7 @@ namespace System.Xml.Xsl.Runtime XsltMessageEncounteredEventHandler onMessage = (_argList != null) ? _argList.xsltMessageEncountered : null; if (onMessage != null) - onMessage(this, new XmlILQueryEventArgs(message)); - else - Console.WriteLine(message); + onMessage(this, new XmlILQueryEventArgs(message)); } } diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/MessageAction.cs b/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/MessageAction.cs index 4910cb122e..6c57672caf 100644 --- a/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/MessageAction.cs +++ b/src/System.Private.Xml/src/System/Xml/Xsl/XsltOld/MessageAction.cs @@ -56,8 +56,7 @@ namespace System.Xml.Xsl.XsltOld case ProcessingChildren: TextOnlyOutput recOutput = processor.PopOutput() as TextOnlyOutput; - Debug.Assert(recOutput != null); - Console.WriteLine(recOutput.Writer.ToString()); + Debug.Assert(recOutput != null); if (_Terminate) { diff --git a/src/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverVariation.cs b/src/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverVariation.cs index f90abf777f..4f00d99d1f 100644 --- a/src/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverVariation.cs +++ b/src/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverVariation.cs @@ -58,8 +58,7 @@ namespace System.Xml.Tests res = (tagVARIATION_STATUS)HandleException(e); } catch (Exception e) - { - Console.WriteLine(e); + { res = (tagVARIATION_STATUS)HandleException(e); } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs index b360f5bd19..43fde8b0fa 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs @@ -85,6 +85,7 @@ namespace System.Xml.Tests Assert.True(false); } + [ActiveIssue(27740, TestPlatforms.AnyUnix)] [Fact] //[Variation(Desc = "TFS_470021 Unexpected local particle qualified name when chameleon schema is added to set")] public void TFS_470021() diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs index 31e44a8e33..707709f43c 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs @@ -893,6 +893,7 @@ namespace System.Xml.Tests } //TFS_538324 + [ActiveIssue(27740, TestPlatforms.AnyUnix)] [Fact] public void XSDValidationGeneratesInvalidError_1() { @@ -919,6 +920,7 @@ namespace System.Xml.Tests } //TFS_538324 + [ActiveIssue(27740, TestPlatforms.AnyUnix)] [Fact] public void XSDValidationGeneratesInvalidError_2() { diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs index 0c6dfaf71d..2f2649b529 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs @@ -609,18 +609,13 @@ namespace System.Xml.Tests AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result>123</result>"; + string fileName = GetType().Name + "_" + Path.GetRandomFileName(); + string testFile = Path.Combine(Path.GetTempPath(), fileName); + string xmlFile = FullFilePath(fileName); // copy file on the local machine try { - string tempPath = Path.GetTempPath(); - string testFile = Path.Combine(tempPath, "xmlResolver_document_function.xml"); - if (File.Exists(testFile)) - { - File.SetAttributes(testFile, FileAttributes.Normal); - File.Delete(testFile); - } - string xmlFile = FullFilePath("xmlResolver_document_function.xml"); File.Copy(xmlFile, testFile, true); } catch (Exception e) @@ -629,6 +624,14 @@ namespace System.Xml.Tests _output.WriteLine("Could not copy file to local. Some other issues prevented this test from running"); return; //TEST_SKIPPED; } + finally + { + if (File.Exists(testFile)) + { + File.SetAttributes(testFile, FileAttributes.Normal); + File.Delete(testFile); + } + } // copy file on the local machine (this is now done with createAPItestfiles.js, see Oasys scenario.) if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl", xslInputType, readerType) == 1) @@ -2522,18 +2525,13 @@ namespace System.Xml.Tests AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result>123</result>"; + string fileName = GetType().Name + "_" + Path.GetRandomFileName(); + string testFile = Path.Combine(Path.GetTempPath(), fileName); + string xmlFile = FullFilePath(fileName); // copy file on the local machine try { - string tempPath = Path.GetTempPath(); - string testFile = Path.Combine(tempPath, "xmlResolver_document_function.xml"); - if (File.Exists(testFile)) - { - File.SetAttributes(testFile, FileAttributes.Normal); - File.Delete(testFile); - } - string xmlFile = FullFilePath("xmlResolver_document_function.xml"); File.Copy(xmlFile, testFile, true); } catch (Exception e) @@ -2542,6 +2540,14 @@ namespace System.Xml.Tests _output.WriteLine("Could not copy file to local. Some other issues prevented this test from running"); return; //TEST_SKIPPED; } + finally + { + if (File.Exists(testFile)) + { + File.SetAttributes(testFile, FileAttributes.Normal); + File.Delete(testFile); + } + } if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl", xslInputType, readerType) == 1) { diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs index e06d0a74e2..f5c7c15859 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs @@ -76,7 +76,7 @@ namespace System.Xml.Tests static XsltApiTestCaseBase2() { // Replace absolute URI in xmlResolver_document_function.xml based on the environment - string targetFile = Path.Combine(Path.GetTempPath(), "xmlResolver_document_function.xml"); + string targetFile = Path.Combine(Path.GetTempPath(), typeof(XsltApiTestCaseBase2) + "_" + Path.GetRandomFileName()); string xslFile = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "XsltApiV2", "xmlResolver_document_function_absolute_uri.xsl"); XmlDocument doc = new XmlDocument(); doc.Load(xslFile); diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs index 010efa92a2..3ef33bd4fc 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs @@ -49,7 +49,7 @@ namespace System.Xml.Tests public class XsltApiTestCaseBase : FileCleanupTestBase { private const string XmlResolverDocumentName = "xmlResolver_document_function.xml"; - private static readonly string s_temporaryResolverDocumentFullName = Path.Combine(Path.GetTempPath(), "XslTransformApi", XmlResolverDocumentName); + private static readonly string s_temporaryResolverDocumentFullName = Path.Combine(Path.GetTempPath(), typeof(XsltApiTestCaseBase) + "_" + Path.GetRandomFileName()); private static readonly object s_temporaryResolverDocumentLock = new object(); // Generic data for all derived test cases |