X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.XML%2FMono.Xml%2FXmlFilterReader.cs;h=24494382abaffc61f64d2edb01e42388bbc0af4b;hb=3d43cfdfccc1aa699e599c39f91fb41231304da9;hp=c2648b32c10c02c07a8ac612818e1148fd882add;hpb=5c5fdf4a98e945946325b84a48af51cf42c3240c;p=mono.git diff --git a/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs b/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs old mode 100755 new mode 100644 index c2648b32c10..24494382aba --- a/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs +++ b/mcs/class/System.XML/Mono.Xml/XmlFilterReader.cs @@ -5,26 +5,26 @@ // Atsushi Enomoto // // Copyright (c) 2004 Novell Inc. All rights reserved -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// // // Similar to SAX DefaultHandler @@ -32,11 +32,13 @@ #if NET_2_0 using System; +using System.Collections.Generic; using System.Xml; +using System.Xml.Schema; namespace Mono.Xml { - public class XmlFilterReader : XmlReader, IXmlLineInfo + internal class XmlFilterReader : XmlReader, IXmlLineInfo, IXmlNamespaceResolver { XmlReader reader; XmlReaderSettings settings; @@ -45,11 +47,22 @@ namespace Mono.Xml public XmlFilterReader (XmlReader reader, XmlReaderSettings settings) { this.reader = reader; - this.settings = settings; + this.settings = settings.Clone (); this.lineInfo = reader as IXmlLineInfo; } #region Properties + +#if NET_2_0 + public override bool CanReadBinaryContent { + get { return reader.CanReadBinaryContent; } + } + + public override bool CanReadValueChunk { + get { return reader.CanReadValueChunk; } + } +#endif + // This is the only one non-overriden property. public XmlReader Reader { get { return reader; } @@ -147,6 +160,16 @@ namespace Mono.Xml public override XmlNameTable NameTable { get { return reader.NameTable; } } + +#if !NET_2_1 + public override IXmlSchemaInfo SchemaInfo { + get { return reader.SchemaInfo; } + } +#endif + + public override XmlReaderSettings Settings { + get { return settings; } + } #endregion #region Methods @@ -203,7 +226,8 @@ namespace Mono.Xml public override void Close () { - reader.Close (); + if (settings.CloseInput) + reader.Close (); } public override bool Read () @@ -232,16 +256,6 @@ namespace Mono.Xml return reader.ReadString (); } - public override string ReadInnerXml () - { - return reader.ReadInnerXml (); - } - - public override string ReadOuterXml () - { - return reader.ReadOuterXml (); - } - public override string LookupNamespace (string prefix) { return reader.LookupNamespace (prefix); @@ -255,6 +269,17 @@ namespace Mono.Xml public override bool ReadAttributeValue () { return reader.ReadAttributeValue (); } + + string IXmlNamespaceResolver.LookupPrefix (string ns) + { + return ((IXmlNamespaceResolver) reader).LookupPrefix (ns); + } + + IDictionary IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope) + { + return ((IXmlNamespaceResolver) reader).GetNamespacesInScope (scope); + } + #endregion } }