Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -34,20 +34,14 @@ using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
#if NET_2_0
using System.Collections.Generic;
#endif
#if NET_2_1
using XmlSchemaException = System.Xml.XmlException;
#else
using Mono.Xml.Schema;
#endif
#if NET_2_0
using XmlTextReaderImpl = Mono.Xml2.XmlTextReader;
#else
using XmlTextReaderImpl = System.Xml.XmlTextReader;
#endif
namespace Mono.Xml
{
@@ -283,7 +277,6 @@ namespace Mono.Xml
}
}
#if NET_2_0
class DictionaryBase : List<KeyValuePair<string,DTDNode>>
{
public IEnumerable<DTDNode> Values {
@@ -293,7 +286,6 @@ namespace Mono.Xml
}
}
}
#endif
internal class DTDCollectionBase : DictionaryBase
{
DTDObjectModel root;
@@ -307,7 +299,6 @@ namespace Mono.Xml
get { return root; }
}
#if NET_2_0
public DictionaryBase InnerHashtable {
get { return this; }
}
@@ -332,30 +323,6 @@ namespace Mono.Xml
return p.Value;
return null;
}
#else
public ICollection Keys {
get { return InnerHashtable.Keys; }
}
public ICollection Values {
get { return InnerHashtable.Values; }
}
protected void BaseAdd (string name, object value)
{
InnerHashtable.Add (name, value);
}
public bool Contains (string key)
{
return InnerHashtable.Contains (key);
}
protected object BaseGet (string name)
{
return InnerHashtable [name];
}
#endif
}
internal class DTDElementDeclarationCollection : DTDCollectionBase

View File

@@ -64,27 +64,19 @@ TODOs:
using System;
using System.Collections;
#if NET_2_0
using System.Collections.Generic;
#endif
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Schema;
#if NET_2_0
using XmlTextReaderImpl = Mono.Xml2.XmlTextReader;
#else
using XmlTextReaderImpl = System.Xml.XmlTextReader;
#endif
namespace Mono.Xml
{
internal class DTDValidatingReader : XmlReader, IXmlLineInfo,
#if NET_2_0
IXmlNamespaceResolver,
#endif
IHasXmlParserContext, IHasXmlSchemaInfo
{
public DTDValidatingReader (XmlReader reader)
@@ -257,13 +249,11 @@ namespace Mono.Xml
return i < 0 ? null : attributes [i].Value;
}
#if NET_2_0
IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope)
{
IXmlNamespaceResolver res = reader as IXmlNamespaceResolver;
return res != null ? res.GetNamespacesInScope (scope) : new Dictionary<string, string> ();
}
#endif
bool IXmlLineInfo.HasLineInfo ()
{
@@ -280,13 +270,11 @@ namespace Mono.Xml
return s == String.Empty ? null : s;
}
#if NET_2_0
string IXmlNamespaceResolver.LookupPrefix (string ns)
{
IXmlNamespaceResolver res = reader as IXmlNamespaceResolver;
return res != null ? res.LookupPrefix (ns) : null;
}
#endif
public override void MoveToAttribute (int i)
{
@@ -395,9 +383,7 @@ namespace Mono.Xml
bool b = ReadContent () || currentTextValue != null;
if (!b &&
#if NET_2_0
(Settings == null || (Settings.ValidationFlags & XmlSchemaValidationFlags.ProcessIdentityConstraints) == 0) &&
#endif
this.missingIDReferences.Count > 0) {
this.HandleError ("Missing ID reference was found: " +
String.Join (",", missingIDReferences.ToArray (typeof (string)) as string []),

View File

@@ -28,12 +28,10 @@
namespace System.Xml {
#if NET_4_0
public enum DtdProcessing
{
Prohibit = 0,
Ignore = 1,
Parse = 2
}
#endif
}

View File

@@ -24,11 +24,7 @@
namespace System.Xml {
[Flags]
#if NET_4_0
public
#else
internal
#endif
enum NamespaceHandling {
Default,
OmitDuplicates = 1,

View File

@@ -27,11 +27,7 @@
//
namespace System.Xml
{
#if NET_2_0
public
#else
internal
#endif
enum NewLineHandling
{
Replace,

View File

@@ -32,14 +32,10 @@ namespace System.Xml
public enum ValidationType
{
None = 0,
#if NET_2_0
[Obsolete]
#endif
Auto = 1,
DTD = 2,
#if NET_2_0
[Obsolete]
#endif
XDR = 3,
Schema = 4,
}

View File

@@ -66,13 +66,11 @@ namespace System.Xml
/// </summary>
Closed = 5,
#if NET_2_0
/// <summary>
/// After an error has happened.
/// </summary>
Error = 6,
#endif
}
}

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Globalization;
@@ -588,4 +587,3 @@ namespace System.Xml
}
}
#endif

View File

@@ -34,9 +34,7 @@ using System;
using System.Text;
using System.Xml.XPath;
using Mono.Xml;
#if NET_2_0
using System.Xml.Schema;
#endif
namespace System.Xml
{
@@ -47,9 +45,7 @@ namespace System.Xml
private XmlNameEntry name;
internal bool isDefault;
XmlLinkedNode lastLinkedChild;
#if NET_2_0
private IXmlSchemaInfo schemaInfo;
#endif
#endregion
@@ -204,12 +200,10 @@ namespace System.Xml
}
}
#if NET_2_0
public override IXmlSchemaInfo SchemaInfo {
get { return schemaInfo; }
internal set { schemaInfo = value; }
}
#endif
public virtual bool Specified {
get {
@@ -252,7 +246,6 @@ namespace System.Xml
#region Methods
#if NET_2_0
public override XmlNode AppendChild (XmlNode newChild)
{
return base.AppendChild (newChild);
@@ -282,7 +275,6 @@ namespace System.Xml
{
return base.ReplaceChild (newChild, oldChild);
}
#endif
public override XmlNode CloneNode (bool deep)
{

View File

@@ -36,11 +36,7 @@ using Mono.Xml;
namespace System.Xml
{
#if NET_2_0
public sealed class XmlAttributeCollection : XmlNamedNodeMap, ICollection
#else
public class XmlAttributeCollection : XmlNamedNodeMap, ICollection
#endif
{
XmlElement ownerElement;
XmlDocument ownerDocument;
@@ -62,33 +58,21 @@ namespace System.Xml
}
[System.Runtime.CompilerServices.IndexerName ("ItemOf")]
#if NET_2_0
public XmlAttribute this [string name] {
#else
public virtual XmlAttribute this [string name] {
#endif
get {
return (XmlAttribute) GetNamedItem (name);
}
}
[System.Runtime.CompilerServices.IndexerName ("ItemOf")]
#if NET_2_0
public XmlAttribute this [int i] {
#else
public virtual XmlAttribute this [int i] {
#endif
get {
return (XmlAttribute) Nodes [i];
}
}
[System.Runtime.CompilerServices.IndexerName ("ItemOf")]
#if NET_2_0
public XmlAttribute this [string localName, string namespaceURI] {
#else
public virtual XmlAttribute this [string localName, string namespaceURI] {
#endif
get {
return (XmlAttribute) GetNamedItem (localName, namespaceURI);
}
@@ -98,11 +82,7 @@ namespace System.Xml
get { return this; }
}
#if NET_2_0
public XmlAttribute Append (XmlAttribute node)
#else
public virtual XmlAttribute Append (XmlAttribute node)
#endif
{
SetNamedItem (node);
return node;
@@ -121,11 +101,7 @@ namespace System.Xml
array.CopyTo (Nodes.ToArray (typeof(XmlAttribute)), index);
}
#if NET_2_0
public XmlAttribute InsertAfter (XmlAttribute newNode, XmlAttribute refNode)
#else
public virtual XmlAttribute InsertAfter (XmlAttribute newNode, XmlAttribute refNode)
#endif
{
if (refNode == null) {
if (Count == 0)
@@ -140,11 +116,7 @@ namespace System.Xml
throw new ArgumentException ("refNode not found in this collection.");
}
#if NET_2_0
public XmlAttribute InsertBefore (XmlAttribute newNode, XmlAttribute refNode)
#else
public virtual XmlAttribute InsertBefore (XmlAttribute newNode, XmlAttribute refNode)
#endif
{
if (newNode.OwnerDocument != ownerDocument)
throw new ArgumentException ("different document created this newNode.");
@@ -170,20 +142,12 @@ namespace System.Xml
return newNode;
}
#if NET_2_0
public XmlAttribute Prepend (XmlAttribute node)
#else
public virtual XmlAttribute Prepend (XmlAttribute node)
#endif
{
return this.InsertAfter (node, null);
}
#if NET_2_0
public XmlAttribute Remove (XmlAttribute node)
#else
public virtual XmlAttribute Remove (XmlAttribute node)
#endif
{
if (IsReadOnly)
throw new ArgumentException ("This attribute collection is read-only.");
@@ -222,11 +186,7 @@ namespace System.Xml
return retAttr;
}
#if NET_2_0
public void RemoveAll ()
#else
public virtual void RemoveAll ()
#endif
{
int current = 0;
while (current < Count) {
@@ -238,11 +198,7 @@ namespace System.Xml
}
}
#if NET_2_0
public XmlAttribute RemoveAt (int i)
#else
public virtual XmlAttribute RemoveAt (int i)
#endif
{
if(Count <= i)
return null;

View File

@@ -54,11 +54,9 @@ namespace System.Xml
get { return XmlNodeType.CDATA; }
}
#if NET_2_0
public override XmlNode ParentNode {
get { return base.ParentNode; }
}
#endif
#endregion

View File

@@ -54,7 +54,6 @@ namespace System.Xml {
static readonly string [] datetimeFormats = {
// dateTime
#if NET_2_0
"yyyy-MM-ddTHH:mm:sszzz",
"yyyy-MM-ddTHH:mm:ss.FFFFFFFzzz",
"yyyy-MM-ddTHH:mm:ssZ",
@@ -67,57 +66,6 @@ namespace System.Xml {
"HH:mm:ss.FFFFFFFzzz",
"HH:mm:ssZ",
"HH:mm:ss.FFFFFFFZ",
#else // it is not required in trunk but should make it easy to backport...
"yyyy-MM-ddTHH:mm:sszzz",
"yyyy-MM-ddTHH:mm:ss.fzzz",
"yyyy-MM-ddTHH:mm:ss.ffzzz",
"yyyy-MM-ddTHH:mm:ss.fffzzz",
"yyyy-MM-ddTHH:mm:ss.ffffzzz",
"yyyy-MM-ddTHH:mm:ss.fffffzzz",
"yyyy-MM-ddTHH:mm:ss.ffffffzzz",
"yyyy-MM-ddTHH:mm:ss.fffffffzzz",
"yyyy-MM-ddTHH:mm:ssZ",
"yyyy-MM-ddTHH:mm:ss.fZ",
"yyyy-MM-ddTHH:mm:ss.ffZ",
"yyyy-MM-ddTHH:mm:ss.fffZ",
"yyyy-MM-ddTHH:mm:ss.ffffZ",
"yyyy-MM-ddTHH:mm:ss.fffffZ",
"yyyy-MM-ddTHH:mm:ss.ffffffZ",
"yyyy-MM-ddTHH:mm:ss.fffffffZ",
"yyyy-MM-ddTHH:mm:ss",
"yyyy-MM-ddTHH:mm:ss.f",
"yyyy-MM-ddTHH:mm:ss.ff",
"yyyy-MM-ddTHH:mm:ss.fff",
"yyyy-MM-ddTHH:mm:ss.ffff",
"yyyy-MM-ddTHH:mm:ss.fffff",
"yyyy-MM-ddTHH:mm:ss.ffffff",
"yyyy-MM-ddTHH:mm:ss.fffffff",
// time
"HH:mm:ss",
"HH:mm:ss.f",
"HH:mm:ss.ff",
"HH:mm:ss.fff",
"HH:mm:ss.ffff",
"HH:mm:ss.fffff",
"HH:mm:ss.ffffff",
"HH:mm:ss.fffffff",
"HH:mm:sszzz",
"HH:mm:ss.fzzz",
"HH:mm:ss.ffzzz",
"HH:mm:ss.fffzzz",
"HH:mm:ss.ffffzzz",
"HH:mm:ss.fffffzzz",
"HH:mm:ss.ffffffzzz",
"HH:mm:ss.fffffffzzz",
"HH:mm:ssZ",
"HH:mm:ss.fZ",
"HH:mm:ss.ffZ",
"HH:mm:ss.fffZ",
"HH:mm:ss.ffffZ",
"HH:mm:ss.fffffZ",
"HH:mm:ss.ffffffZ",
"HH:mm:ss.fffffffZ",
#endif
// date
"yyyy-MM-dd",
"yyyy-MM-ddzzz",
@@ -316,15 +264,12 @@ namespace System.Xml {
#endif
}
#if NET_2_0
[Obsolete]
#endif
public static DateTime ToDateTime (string s)
{
return ToDateTime (s, datetimeFormats);
}
#if NET_2_0
public static DateTime ToDateTime (string s, XmlDateTimeSerializationMode dateTimeOption)
{
switch (dateTimeOption) {
@@ -338,7 +283,6 @@ namespace System.Xml {
return new DateTime (ToDateTime(s, datetimeFormats, _defaultStyle | DateTimeStyles.RoundtripKind).Ticks, DateTimeKind.Unspecified);
}
}
#endif
public static DateTime ToDateTime(string s, string format)
{
//DateTimeFormatInfo d = new DateTimeFormatInfo();
@@ -574,15 +518,12 @@ namespace System.Xml {
return value.ToString(CultureInfo.InvariantCulture);
}
#if NET_2_0
[Obsolete]
#endif
public static string ToString (DateTime value)
{
return value.ToString ("yyyy-MM-ddTHH:mm:ss.fffffffzzz", CultureInfo.InvariantCulture);
}
#if NET_2_0
public static string ToString (DateTime value, XmlDateTimeSerializationMode dateTimeOption)
{
// Unlike usual DateTime formatting, it preserves
@@ -610,7 +551,6 @@ namespace System.Xml {
CultureInfo.InvariantCulture);
}
}
#endif
public static string ToString(DateTime value, string format)
{
@@ -790,11 +730,7 @@ namespace System.Xml {
return token;
}
#if NET_2_0
public static string VerifyNMTOKEN (string name)
#else
internal static string VerifyNMTOKEN (string name)
#endif
{
if (name == null)
throw new ArgumentNullException("name");
@@ -837,7 +773,6 @@ namespace System.Xml {
return bufIndex - offset;
}
#if NET_2_0 // actually NET_3_5
public static DateTimeOffset ToDateTimeOffset (string s)
{
@@ -874,9 +809,7 @@ namespace System.Xml {
return new Uri (s, UriKind.RelativeOrAbsolute);
}
#endif
#if NET_4_0
public static bool IsNCNameChar (char ch)
{
return XmlChar.IsNCNameChar (ch);
@@ -934,6 +867,5 @@ namespace System.Xml {
return content;
throw new XmlException (string.Format ("Invalid XML character was found in the content, at index {0}.", idx));
}
#endif
}
}

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Xml {
@@ -40,4 +39,3 @@ namespace System.Xml {
}
#endif

View File

@@ -42,10 +42,8 @@ using System.Xml.XPath;
using System.Diagnostics;
using System.Collections;
using Mono.Xml;
#if NET_2_0
using System.Xml.Schema;
using Mono.Xml.XPath;
#endif
namespace System.Xml
{
@@ -64,10 +62,8 @@ namespace System.Xml
XmlNameEntryCache nameCache;
XmlLinkedNode lastLinkedChild;
XmlAttribute nsNodeXml;
#if NET_2_0
XmlSchemaSet schemas;
IXmlSchemaInfo schemaInfo;
#endif
// MS.NET rejects undeclared entities _only_ during Load(),
// while ReadNode() never rejects such node. So it signs
@@ -179,11 +175,9 @@ namespace System.Xml
get { return implementation; }
}
#if NET_4_0
public override string InnerText {
set { throw new InvalidOperationException (); }
}
#endif
public override string InnerXml {
get {
@@ -270,7 +264,6 @@ namespace System.Xml
}
}
#if NET_2_0
public override XmlNode ParentNode {
get { return null; }
}
@@ -288,7 +281,6 @@ namespace System.Xml
get { return schemaInfo; }
internal set { schemaInfo = value; }
}
#endif
#endregion
@@ -437,20 +429,14 @@ namespace System.Xml
return new XmlEntityReference (name, this);
}
#if NET_2_0
public override XPathNavigator CreateNavigator ()
{
return CreateNavigator (this);
}
#endif
protected internal virtual XPathNavigator CreateNavigator (XmlNode node)
{
#if NET_2_0
return new XPathEditableDocument (node).CreateNavigator ();
#else
return new XmlDocumentNavigator (node);
#endif
}
public virtual XmlNode CreateNode (
@@ -496,11 +482,7 @@ namespace System.Xml
case XmlNodeType.Whitespace: return CreateWhitespace (String.Empty);
case XmlNodeType.XmlDeclaration: return CreateXmlDeclaration ("1.0", null, null);
default:
#if NET_2_0
throw new ArgumentException (
#else // makes less sense
throw new ArgumentOutOfRangeException (
#endif
String.Format("{0}\nParameter name: {1}",
"Specified argument was out of the range of valid values", type.ToString ()));
}
@@ -574,10 +556,8 @@ namespace System.Xml
private XmlNodeType GetNodeTypeFromString (string nodeTypeString)
{
#if NET_2_0 // actually should be done in any version
if (nodeTypeString == null)
throw new ArgumentNullException ("nodeTypeString");
#endif
switch (nodeTypeString) {
case "attribute": return XmlNodeType.Attribute;
case "cdatasection": return XmlNodeType.CDATA;
@@ -741,10 +721,8 @@ namespace System.Xml
if (preserveWhitespace || n.NodeType != XmlNodeType.Whitespace)
AppendChild (n, false);
} while (reader.NodeType != XmlNodeType.EndElement);
#if NET_2_0
if (reader.Settings != null)
schemas = reader.Settings.Schemas;
#endif
} finally {
loadMode = false;
}
@@ -829,10 +807,8 @@ namespace System.Xml
else if (reader.NodeType != XmlNodeType.Attribute)
throw new InvalidOperationException (MakeReaderErrorMessage ("bad position to read attribute.", reader));
XmlAttribute attribute = CreateAttribute (reader.Prefix, reader.LocalName, reader.NamespaceURI);
#if NET_2_0
if (reader.SchemaInfo != null)
SchemaInfo = reader.SchemaInfo;
#endif
bool isDefault = reader.IsDefault;
ReadAttributeNodeValue (reader, attribute);
@@ -858,20 +834,7 @@ namespace System.Xml
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public virtual XmlNode ReadNode (XmlReader reader)
{
if (PreserveWhitespace)
return ReadNodeCore (reader);
XmlTextReader xtr = reader as XmlTextReader;
if (xtr != null && xtr.WhitespaceHandling ==
WhitespaceHandling.All) {
try {
xtr.WhitespaceHandling = WhitespaceHandling.Significant;
return ReadNodeCore (reader);
} finally {
xtr.WhitespaceHandling = WhitespaceHandling.All;
}
}
else
return ReadNodeCore (reader);
return ReadNodeCore (reader);
}
XmlNode ReadNodeCore (XmlReader reader)
@@ -880,10 +843,8 @@ namespace System.Xml
case ReadState.Interactive:
break;
case ReadState.Initial:
#if NET_2_0
if (reader.SchemaInfo != null)
SchemaInfo = reader.SchemaInfo;
#endif
reader.Read ();
break;
default:
@@ -911,10 +872,8 @@ namespace System.Xml
case XmlNodeType.Element:
XmlElement element = CreateElement (reader.Prefix, reader.LocalName, reader.NamespaceURI, reader.NameTable == this.NameTable);
#if NET_2_0
if (reader.SchemaInfo != null)
element.SchemaInfo = reader.SchemaInfo;
#endif
element.IsEmpty = reader.IsEmptyElement;
// set the element's attributes.
@@ -1121,7 +1080,6 @@ namespace System.Xml
}
}
#if NET_2_0
public void Validate (ValidationEventHandler validationEventHandler)
{
Validate (validationEventHandler, this,
@@ -1149,7 +1107,6 @@ namespace System.Xml
while (!r.EOF)
r.Read ();
}
#endif
#endregion
}

View File

@@ -208,7 +208,6 @@ namespace System.Xml
get { return (NsNode != null) ? String.Empty : node.Prefix; }
}
#if NET_2_0
public override IXmlSchemaInfo SchemaInfo {
get { return NsNode != null ? null : node.SchemaInfo; }
}
@@ -216,7 +215,6 @@ namespace System.Xml
public override object UnderlyingObject {
get { return node; }
}
#endif
public override string Value {
get {
@@ -358,13 +356,6 @@ namespace System.Xml
return false;
}
#if NET_2_0
#else
public override bool MoveToFirst ()
{
return MoveToFirstImpl ();
}
#endif
public override bool MoveToFirstAttribute ()
{
@@ -749,77 +740,49 @@ namespace System.Xml
return null;
}
#if NET_2_0
public
#else
internal
#endif
override string LookupNamespace (string prefix)
{
// FIXME: optimize
return base.LookupNamespace (prefix);
}
#if NET_2_0
public
#else
internal
#endif
override string LookupPrefix (string namespaceUri)
{
// FIXME: optimize
return base.LookupPrefix (namespaceUri);
}
#if NET_2_0
public
#else
internal
#endif
override bool MoveToChild (XPathNodeType type)
{
// FIXME: optimize
return base.MoveToChild (type);
}
#if NET_2_0
public
#else
internal
#endif
override bool MoveToChild (string localName, string namespaceURI)
{
// FIXME: optimize
return base.MoveToChild (localName, namespaceURI);
}
#if NET_2_0
public
#else
internal
#endif
override bool MoveToNext (string localName, string namespaceURI)
{
// FIXME: optimize
return base.MoveToNext (localName, namespaceURI);
}
#if NET_2_0
public
#else
internal
#endif
override bool MoveToNext (XPathNodeType type)
{
// FIXME: optimize
return base.MoveToNext (type);
}
#if NET_2_0
public
#else
internal
#endif
override bool MoveToFollowing (string localName,
string namespaceURI, XPathNavigator end)
{
@@ -827,11 +790,7 @@ namespace System.Xml
return base.MoveToFollowing (localName, namespaceURI, end);
}
#if NET_2_0
public
#else
internal
#endif
override bool MoveToFollowing (XPathNodeType type,
XPathNavigator end)
{

View File

@@ -32,11 +32,7 @@ using System.IO;
using System.Collections;
using Mono.Xml;
#if NET_2_0
using XmlTextReaderImpl = Mono.Xml2.XmlTextReader;
#else
using XmlTextReaderImpl = System.Xml.XmlTextReader;
#endif
namespace System.Xml
{

View File

@@ -152,11 +152,17 @@ namespace System.Xml
XmlTextReader xmlReader = new XmlTextReader (value, XmlNodeType.Element, ctx);
xmlReader.XmlResolver = OwnerDocument.Resolver;
do {
XmlNode n = OwnerDocument.ReadNode (xmlReader);
if(n == null) break;
AppendChild (n);
} while (true);
bool pw = OwnerDocument.PreserveWhitespace;
OwnerDocument.PreserveWhitespace = true;
try {
do {
XmlNode n = OwnerDocument.ReadNode (xmlReader);
if(n == null) break;
AppendChild (n);
} while (true);
} finally {
OwnerDocument.PreserveWhitespace = pw;
}
}
}

View File

@@ -77,9 +77,7 @@ namespace System.Xml
this.linePosition = info.GetInt32 ("linePosition");
this.res = info.GetString ("res");
this.messages = (string []) info.GetValue ("args", typeof(string []));
#if NET_2_0
this.sourceUri = info.GetString ("sourceUri");
#endif
}
public XmlException (string message)
@@ -154,11 +152,9 @@ namespace System.Xml
get { return linePosition; }
}
#if NET_2_0
public string SourceUri {
get { return sourceUri; }
}
#endif
public override string Message {
get {
@@ -182,9 +178,7 @@ namespace System.Xml
info.AddValue ("linePosition", linePosition);
info.AddValue ("res", res);
info.AddValue ("args", messages);
#if NET_2_0
info.AddValue ("sourceUri", sourceUri);
#endif
}
#endregion

View File

@@ -158,11 +158,7 @@ namespace System.Xml
{
pos = decoded_count = 0;
mayBlock = false;
#if NET_2_0
decoder.Reset ();
#else
decoder = encoding.GetDecoder ();
#endif
}
// the buffer is empty, fill it again

View File

@@ -33,9 +33,7 @@
//
using System.Collections;
#if NET_2_0
using System.Collections.Generic;
#endif
using System.Collections.Specialized;
namespace System.Xml
@@ -123,11 +121,7 @@ namespace System.Xml
get { return defaultNamespace == null ? string.Empty : defaultNamespace; }
}
#if NET_2_0
public virtual XmlNameTable NameTable {
#else
public XmlNameTable NameTable {
#endif
get { return nameTable; }
}
@@ -212,7 +206,6 @@ namespace System.Xml
return ht.Keys.GetEnumerator ();
}
#if NET_2_0
public virtual IDictionary<string, string> GetNamespacesInScope (XmlNamespaceScope scope)
{
IDictionary namespaceTable = GetNamespacesInScopeImpl (scope);
@@ -223,12 +216,6 @@ namespace System.Xml
}
return namespaces;
}
#else
IDictionary IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope)
{
return GetNamespacesInScopeImpl (scope);
}
#endif
internal virtual IDictionary GetNamespacesInScopeImpl (XmlNamespaceScope scope)
{
@@ -310,11 +297,7 @@ namespace System.Xml
public virtual string LookupPrefix (string uri)
{
#if NET_2_0
return LookupPrefix (uri, false);
#else
return LookupPrefix (uri, true);
#endif
}
private bool CompareString (string s1, string s2, bool atomizedNames)

Some files were not shown because too many files have changed in this diff Show More