Skip to content

Commit

Permalink
First step to import referencesource System.Xml.
Browse files Browse the repository at this point in the history
It is not simply replacement because we have to workaround dynamic codegen
for Xamarin.iOS.

Also there were several tests failing with MS implementation (e.g. for
W3C DOM conformance), so we had to disable them.

There is one regression that rather needs to be fixed in Reflection.Emit.

Also, some WCF tests fail with this implementation. They need to be
investigated, reviewed and appropriately fixed.
  • Loading branch information
atsushieno committed Mar 2, 2015
1 parent b862ff8 commit 4990b4c
Show file tree
Hide file tree
Showing 41 changed files with 2,216 additions and 92 deletions.
99 changes: 99 additions & 0 deletions mcs/class/System.XML/Dummy.cs
@@ -0,0 +1,99 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Xml.Schema;

namespace System
{
static class AssemblyRef
{
public const string MicrosoftJScript = "Microsoft.JScript";
public const string SystemData = "System.Data";
}

static class ThisAssembly
{
public const string Version = "System.Xml";
}
}

// Types within this namespace are taken from referencesource
namespace System.Xml.Serialization
{
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------

// from Models.cs
internal enum SpecifiedAccessor {
None,
ReadOnly,
ReadWrite,
}

// from Types.cs
internal class TypeScope
{
static internal XmlQualifiedName ParseWsdlArrayType(string type, out string dims, XmlSchemaObject parent) {
string ns;
string name;

int nsLen = type.LastIndexOf(':');

if (nsLen <= 0) {
ns = "";
}
else {
ns = type.Substring(0, nsLen);
}
int nameLen = type.IndexOf('[', nsLen + 1);

if (nameLen <= nsLen) {
throw new InvalidOperationException(Res.GetString(Res.XmlInvalidArrayTypeSyntax, type));
}
name = type.Substring(nsLen + 1, nameLen - nsLen - 1);
dims = type.Substring(nameLen);

// parent is not null only in the case when we used XmlSchema.Read(),
// in which case we need to fixup the wsdl:arayType attribute value
while (parent != null) {
if (parent.Namespaces != null) {
string wsdlNs = (string)parent.Namespaces.Namespaces[ns];
if (wsdlNs != null) {
ns = wsdlNs;
break;
}
}
parent = parent.Parent;
}
return new XmlQualifiedName(name, ns);
}
}
internal class Wsdl {
private Wsdl() { }
internal const string Namespace = "http://schemas.xmlsoap.org/wsdl/";
internal const string ArrayType = "arrayType";
}
}

namespace System.Security.Policy
{
static class EvidenceExtensions
{
public static void AddHostEvidence (this Evidence evidence, Url url)
{
throw new NotImplementedException ();
}
public static void AddHostEvidence (this Evidence evidence, Zone zone)
{
throw new NotImplementedException ();
}
public static void AddHostEvidence (this Evidence evidence, Site site)
{
throw new NotImplementedException ();
}
public static void AddHostEvidence (this Evidence evidence, EvidenceBase e)
{
throw new NotImplementedException ();
}
}
}
7 changes: 6 additions & 1 deletion mcs/class/System.XML/Makefile
Expand Up @@ -16,7 +16,8 @@ endif
PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammac mobile mobile_static, $(PROFILE))

LIB_REFS = System
LIB_MCS_FLAGS = -r:$(corlib) -r:System.dll -nowarn:0618,0612,0642
LIB_MCS_FLAGS = -r:$(corlib) -r:System.dll -nowarn:0618,0612,0642 -unsafe -d:ASYNC -d:DISABLE_CAS_USE -d:MONO_HYBRID_SYSTEM_XML

ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -unsafe -d:AGCLR -d:NET_2_1_HACK
endif
Expand Down Expand Up @@ -66,6 +67,8 @@ EXTRA_DISTFILES = \
$(xmlfiles_files:%=Test/XmlFiles/%) \
$(nist_dom_files:%=Test/System.Xml/nist_dom/%)

ifneq (net_4_5, $(PROFILE))

System.Xml.XPath/$(PROFILE)_Parser.cs: System.Xml.XPath/Parser.jay $(topdir)/jay/skeleton.cs
(cd System.Xml.XPath; $(topdir)/../jay/jay -ct < $(topdir)/../jay/skeleton.cs Parser.jay > $(PROFILE)_Parser.cs)

Expand All @@ -91,6 +94,8 @@ CLEAN_FILES = Test/XmlFiles/xsl/result.xml \
Mono.Xml.Xsl/$(PROFILE)_PatternTokenizer.cs
endif

endif

include ../../build/library.make

ifeq (bare/,$(intermediate))
Expand Down

0 comments on commit 4990b4c

Please sign in to comment.