diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-12-08 11:43:34 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-12-08 11:43:34 +0300 |
commit | 379179256ed3479cc7e1e23eba0aecc9e50dab54 (patch) | |
tree | 4ef83138ccc31bf17037298c83968742038f4ad8 /mcs/class/System.XML | |
parent | fff797f63f9fa119a03d499d0ef2d9736c4e5ace (diff) |
2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
* Driver.cs, Profiler.cs, XmlQualifiedNameTable.cs :
removed old code.
svn path=/trunk/mcs/; revision=54102
Diffstat (limited to 'mcs/class/System.XML')
-rw-r--r-- | mcs/class/System.XML/System.Xml/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/Driver.cs | 77 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/Profile.cs | 68 | ||||
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlQualifiedNameTable.cs | 138 |
4 files changed, 5 insertions, 283 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index 343b1779c03..50c7595afb2 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,5 +1,10 @@ 2005-12-08 Atsushi Enomoto <atsushi@ximian.com> + * Driver.cs, Profiler.cs, XmlQualifiedNameTable.cs : + removed old code. + +2005-12-08 Atsushi Enomoto <atsushi@ximian.com> + * XmlReaderSettings.cs : thanks to idiotic MS design, AllowXmlAttributes is turned on by default. diff --git a/mcs/class/System.XML/System.Xml/Driver.cs b/mcs/class/System.XML/System.Xml/Driver.cs deleted file mode 100644 index 4ec48ba2e32..00000000000 --- a/mcs/class/System.XML/System.Xml/Driver.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// Driver.cs -// -// Author: -// Jason Diamond (jason@injektilo.org) -// -// (C) 2001 Jason Diamond http://injektilo.org/ -// - -// -// 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. -// - -using System; -using System.Xml; - -public class Driver -{ - public static void Main(string[] args) - { - XmlReader xmlReader = null; - - if (args.Length < 1) - { - xmlReader = new XmlTextReader(Console.In); - } - else - { - xmlReader = new XmlTextReader(args[0]); - } - - while (xmlReader.Read()) - { - Console.WriteLine("NodeType = {0}", xmlReader.NodeType); - Console.WriteLine(" Name = {0}", xmlReader.Name); - Console.WriteLine(" IsEmptyElement = {0}", xmlReader.IsEmptyElement); - Console.WriteLine(" HasAttributes = {0}", xmlReader.HasAttributes); - Console.WriteLine(" AttributeCount = {0}", xmlReader.AttributeCount); - Console.WriteLine(" HasValue = {0}", xmlReader.HasValue); - Console.WriteLine(" Value = {0}", xmlReader.Value); - Console.WriteLine(" Depth = {0}", xmlReader.Depth); - - if (xmlReader.HasAttributes) - { - while (xmlReader.MoveToNextAttribute()) - { - Console.WriteLine(" AttributeName = {0}", xmlReader.Name); - Console.WriteLine(" AttributeValue = {0}", xmlReader.Value); - - while (xmlReader.ReadAttributeValue()) - { - Console.WriteLine(" AttributeValueNodeType = {0}", xmlReader.NodeType); - Console.WriteLine(" AttributeValueName = {0}", xmlReader.Name); - Console.WriteLine(" AttributeValueValue = {0}", xmlReader.Value); - } - } - } - } - } -} diff --git a/mcs/class/System.XML/System.Xml/Profile.cs b/mcs/class/System.XML/System.Xml/Profile.cs deleted file mode 100644 index 7ed5beaac07..00000000000 --- a/mcs/class/System.XML/System.Xml/Profile.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- -// -// Profile.cs -// -// Author: -// Jason Diamond (jason@injektilo.org) -// -// (C) 2001 Jason Diamond http://injektilo.org/ -// - -// -// 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. -// - -using System; -using System.Xml; - -using System.IO; -using System.Text; - -public class Profile -{ - public static void Main(string[] args) - { - XmlReader xmlReader = null; - - if (args.Length < 1) - { - xmlReader = new XmlTextReader(Console.In); - } - else - { - xmlReader = new XmlTextReader(args[0]); - } - - int nodes = 0; - - DateTime start = DateTime.Now; - - while (xmlReader.Read()) - { - ++nodes; - } - - DateTime end = DateTime.Now; - - Console.WriteLine("time = {0}", end - start); - - Console.WriteLine("nodes = {0}", nodes); - } -} diff --git a/mcs/class/System.XML/System.Xml/XmlQualifiedNameTable.cs b/mcs/class/System.XML/System.Xml/XmlQualifiedNameTable.cs deleted file mode 100644 index 33728a887ea..00000000000 --- a/mcs/class/System.XML/System.Xml/XmlQualifiedNameTable.cs +++ /dev/null @@ -1,138 +0,0 @@ -// -// XmlQualifiedNameTable.cs -// -// Author: -// Atsushi Enomoto <ginga@kit.hi-ho.ne.jp> -// -// - -// -// 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. -// -#if NET_2_0 - -using System; -using System.Collections; - -using QName = System.Xml.XmlQualifiedName; - -namespace System.Xml -{ - public class XmlQualifiedNameTable - { - XmlNameTable nameTable; - Hashtable namespaces = new Hashtable (); - - public XmlQualifiedNameTable (XmlNameTable nameTable) - { - this.nametable = nameTable; - } - - public XmlNameTable NameTable { - get { return nameTable; } - } - - public XmlQualifiedName Add (string name, string ns) - { - return AddInternal (name, ns, false); - } - - public XmlQualifiedName AtomizedAdd (string name, string ns) - { - return AddInternal (name, ns, true); - } - - private XmlQualifiedName AddInternal (string name, string ns, - bool atomized) - { - if (!atomized) { - name = nameTable.Add (name); - ns = nameTable.Add (ns); - } - Hashtable nsTable = namespaces [ns] as Hashtable; - if (nsTable == null) { - nsTable = new Hashtable (); - namespaces [ns] = nsTable; - } - QName qname = nsTable [name] as QName; - if (name == null) { - qname = new QName (name, ns); - nsTable [name] = qname; - } - return qname; - } - - public XmlQualifiedName AtomizedGet (string name, string ns) - { - throw new NotImplementedException (); - } - - public XmlQualifiedName Get (string name, string ns) - { - throw new NotImplementedException (); - } - - private XmlQualifiedName GetInternal (string name, string ns, - bool atomized) - { - if (atomized) { - if (nameTable.Get (name) == null || - nameTable.Get (ns) == null) - return null; - } - Hashtable nsTable = namespaces [ns] as Hashtable; - return nsTable != null ? - nsTable [name] as QName : null; - } - - public IEnumerator GetEnumerator () - { - return new XmlQualifiedNameTableEnumerator (this); - } - - internal class XmlQualifiedNameTableEnumerator : IEnumerator - { - public XmlQualifiedNameTableEnumerator ( - XmlQualifiedNameTable qnameTable) - { - namespaces = qnameTable.namespaces.GetEnumerator (); - } - - IEnumerator namespaces; - IEnumerator names; - - public bool MoveNext () - { - while (names == null || !names.MoveNext ()) { - if (!namespaces.MoveNext ()) - return false; - names = ((Hashtable) namespaces.Current).GetEnumerator (); - } - return true; - } - - public object Current { - get { return names.Current; } - } - } - } -} - -#endif |