Browse Source

2004-05-22 Atsushi Enomoto <[email protected]>

	* IXmlCompilerInclude.cs,
	  QueryEventArgs.cs,
	  QuertEventHandler.cs,
	  XmlArgumentList.cs,
	  XsltCommand.cs : added.

	* XmlQueryArgumentList.cs,
	  XsltProcessor.cs : removed (only in .NET 1.2).

	* XmlCommand.cs,
	  XmlQueryCompileException.cs,
	  XmlQueryException.cs : updated API to that of .NET 2.0.

svn path=/trunk/mcs/; revision=27882
Atsushi Eno 21 years ago
parent
commit
06fd5a823c

+ 15 - 0
mcs/class/System.XML/System.Xml.Query/ChangeLog

@@ -1,3 +1,18 @@
+2004-05-22  Atsushi Enomoto <[email protected]>
+
+	* IXmlCompilerInclude.cs,
+	  QueryEventArgs.cs,
+	  QuertEventHandler.cs,
+	  XmlArgumentList.cs,
+	  XsltCommand.cs : added.
+
+	* XmlQueryArgumentList.cs,
+	  XsltProcessor.cs : removed (only in .NET 1.2).
+
+	* XmlCommand.cs,
+	  XmlQueryCompileException.cs,
+	  XmlQueryException.cs : updated API to that of .NET 2.0.
+
 2003-12-14  Tim Coleman <[email protected]>
 	* ChangeLog XmlCommand.cs XmlQueryArgumentList.cs
 	* XmlQueryCompileException.cs XmlQueryException.cs XsltProcessor.cs:

+ 33 - 0
mcs/class/System.XML/System.Xml.Query/IXmlCompilerInclude.cs

@@ -0,0 +1,33 @@
+//
+// IXmlCompilerInclude.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+
+#if NET_2_0
+using System.Xml;
+using MS.Internal.Xml.Query;
+
+namespace System.Xml.Query
+{
+	public interface IXmlCompilerInclude
+	{
+		XmlExpression ResolveContextDocument ();
+
+		XmlExpression ResolveFunction (XmlQualifiedName name, object [] parameters);
+
+		XmlExpression ResolveVariable (XmlQualifiedName varName);
+	}
+}
+
+// FIXME: This class should be in System.Xml in the future, but MS still keeps
+// this class in MS.Internal
+
+namespace MS.Internal.Xml.Query
+{
+	public class XmlExpression
+	{
+	}
+}
+#endif

+ 22 - 0
mcs/class/System.XML/System.Xml.Query/QueryEventArgs.cs

@@ -0,0 +1,22 @@
+//
+// QueryEventArgs.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+
+#if NET_2_0
+namespace System.Xml.Query
+{
+	public abstract class QueryEventArgs : EventArgs
+	{
+		[MonoTODO]
+		protected QueryEventArgs ()
+		{
+		}
+
+		public abstract string Message { get; }
+	}
+}
+
+#endif

+ 15 - 0
mcs/class/System.XML/System.Xml.Query/QueryEventHandler.cs

@@ -0,0 +1,15 @@
+//
+// QueryEventHandler.cs
+//
+// Author:
+//	Atsushi Enomoto <[email protected]>
+//
+
+#if NET_2_0
+
+namespace System.Xml.Query
+{
+	public delegate void QueryEventHandler (object sender, QueryEventArgs e);
+}
+
+#endif

+ 102 - 0
mcs/class/System.XML/System.Xml.Query/XmlArgumentList.cs

@@ -0,0 +1,102 @@
+//
+// System.Xml.Query.XmlArgumentList
+//
+// Author:
+//   Tim Coleman ([email protected])
+//   Atsushi Enomoto ([email protected])
+//
+// Copyright (C) Tim Coleman, 2003
+// Copyright (C) Novell Inc, 2004
+//
+
+#if NET_2_0
+
+using System.Collections;
+using System.Xml;
+
+namespace System.Xml.Query 
+{
+	public class XmlArgumentList
+	{
+		#region	Fields
+
+		Hashtable extensionObjects;
+		Hashtable parameters;
+
+		#endregion // Fields
+
+		#region	Constructors
+
+		[MonoTODO]
+		public XmlArgumentList ()
+		{
+			extensionObjects = new Hashtable ();
+			parameters = new Hashtable ();
+		}
+
+		#endregion // Constructors
+
+		#region	Methods
+
+		[MonoTODO ("Confirm name conflicts")]
+		public void AddExtensionObject (string namespaceUri, object value)
+		{
+			extensionObjects.Add (namespaceUri, value);
+		}
+
+		[MonoTODO ("Confirm name conflicts")]
+		public void AddParameter (string localName,	string namespaceUri, object value)
+		{
+			parameters.Add (new XmlQualifiedName (localName, namespaceUri), value);
+		}
+
+		public void ClearExtensionObjects ()
+		{
+			extensionObjects.Clear ();
+		}
+
+		public void ClearParameters ()
+		{
+			parameters.Clear ();
+		}
+
+		public object GetExtensionObject (string namespaceUri)
+		{
+			return extensionObjects [namespaceUri];
+		}
+
+		[MonoTODO ("Performance")]
+		public object GetParameter (string localName, string namespaceUri)
+		{
+			return parameters [new XmlQualifiedName (localName, namespaceUri)];
+		}
+
+		[MonoTODO]
+		public void RemoveExtensionObject (string namespaceUri)
+		{
+			extensionObjects.Remove (namespaceUri);
+		}
+
+		[MonoTODO]
+		public void RemoveParameter (string localName, string namespaceUri)
+		{
+			parameters.Remove (new XmlQualifiedName (localName, namespaceUri));
+		}
+
+		[MonoTODO]
+		public void SetExtensionObject (string namespaceUri, object value)
+		{
+			extensionObjects [namespaceUri] = value;
+		}
+
+		[MonoTODO]
+		public void SetParameter (string localName, string namespaceUri, object value)
+		{
+			parameters [new XmlQualifiedName (localName, namespaceUri)] = value;
+		}
+
+		#endregion // Methods
+	}
+}
+
+#endif // NET_2_0

+ 63 - 26
mcs/class/System.XML/System.Xml.Query/XmlCommand.cs

@@ -1,26 +1,63 @@
-//
-// System.Xml.Query.XmlCommand
-//
-// Author:
-//   Tim Coleman ([email protected])
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-#if NET_2_0
-
-using System.IO;
-
-namespace System.Xml.Query {
-        public abstract class XmlCommand
-        {
-		#region Methods
-
-		public abstract void Execute (string contextDocumentUri, XmlResolver dataSources, XmlQueryArgumentList argList, TextWriter results);
-		public abstract void Execute (string contextDocumentUri, XmlResolver dataSources, XmlQueryArgumentList argList, Stream results);
-
-		#endregion // Methods
-        }
-}
-
-#endif // NET_2_0
+//
+// System.Xml.Query.XmlCommand
+//
+// Author:
+//   Tim Coleman ([email protected])
+//   Atsushi Enomoto ([email protected])
+//
+// Copyright (C) Tim Coleman, 2003
+// Copyright (C) Novell Inc, 2004
+//
+
+#if NET_2_0
+
+using System.IO;
+using System.Xml.XPath;
+
+namespace System.Xml.Query
+{
+        public abstract class XmlCommand
+        {
+		public event QueryEventHandler OnProcessingEvent;
+
+		public abstract void Execute (
+			IXPathNavigable contextDocument,
+			XmlWriter writer);
+
+		public abstract void Execute (
+			IXPathNavigable contextDocument,
+			XmlArgumentList args,
+			XmlWriter writer);
+
+		public abstract void Execute (
+			XmlResolver dataSource,
+			XmlArgumentList args,
+			XmlWriter writer);
+
+		public abstract void Execute (
+			IXPathNavigable contextDocument,
+			XmlResolver dataSource,
+			XmlArgumentList args,
+			XmlWriter writer);
+
+		public abstract void Execute (
+			string contextDocumentUri, 
+			XmlResolver dataSources, 
+			XmlArgumentList argList, 
+			Stream results);
+
+		public abstract void Execute (
+			string contextDocumentUri,
+			XmlResolver dataSources,
+			XmlArgumentList argList,
+			TextWriter results);
+
+		public abstract void Execute (
+			string contextDocumentUri,
+			XmlResolver dataSources,
+			XmlArgumentList argList,
+			XmlWriter results);
+        }
+}
+
+#endif // NET_2_0

+ 0 - 96
mcs/class/System.XML/System.Xml.Query/XmlQueryArgumentList.cs

@@ -1,96 +0,0 @@
-//
-// System.Xml.Query.XmlQueryArgumentList
-//
-// Author:
-//   Tim Coleman ([email protected])
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-#if NET_2_0
-
-using System.Collections;
-using System.Xml;
-
-namespace System.Xml.Query {
-        public class XmlQueryArgumentList
-        {
-		#region Fields
-
-		Hashtable extensionObjects;
-		Hashtable parameters;
-
-		#endregion // Fields
-
-		#region Constructors
-
-		[MonoTODO]
-		public XmlQueryArgumentList ()
-		{
-			extensionObjects = new Hashtable ();
-			parameters = new Hashtable ();
-		}
-
-		#endregion // Constructors
-
-		#region Methods
-
-		[MonoTODO]
-		public void AddExtensionObject (string namespaceUri, object value)
-		{
-			extensionObjects [namespaceUri] = value;
-		}
-
-		[MonoTODO]
-		public void AddParam (string localName, string namespaceUri, object value)
-		{
-			AddParam (new XmlQualifiedName (localName, namespaceUri), value);
-		}
-
-		[MonoTODO]
-		private void AddParam (XmlQualifiedName qname, object value)
-		{
-			parameters [qname] = value;
-		}
-
-		[MonoTODO]
-		public object GetExtensionObject (string namespaceUri)
-		{
-			return extensionObjects [namespaceUri];
-		}
-
-		[MonoTODO]
-		public object GetParam (string localName, string namespaceUri)
-		{
-			return GetParam (new XmlQualifiedName (localName, namespaceUri));
-		}
-
-		[MonoTODO]
-		private object GetParam (XmlQualifiedName qname)
-		{
-			return parameters [qname];
-		}
-
-		[MonoTODO]
-		public void RemoveExtensionObject (string namespaceUri)
-		{
-			extensionObjects.Remove (namespaceUri);	
-		}
-
-		[MonoTODO]
-		public void RemoveParam (string localName, string namespaceUri)
-		{
-			RemoveParam (new XmlQualifiedName (localName, namespaceUri));
-		}
-
-		[MonoTODO]
-		private void RemoveParam (XmlQualifiedName qname)
-		{
-			parameters.Remove (qname);
-		}
-
-		#endregion // Methods
-        }
-}
-
-#endif // NET_2_0

+ 8 - 14
mcs/class/System.XML/System.Xml.Query/XmlQueryCompileException.cs

@@ -3,8 +3,10 @@
 //
 // Author:
 //   Tim Coleman ([email protected])
+//   Atsushi Enomoto ([email protected])
 //
 // Copyright (C) Tim Coleman, 2003
+// Copyright (C) Novell Inc., 2004
 //
 
 #if NET_2_0
@@ -12,12 +14,13 @@
 using System;
 using System.Runtime.Serialization;
 
-namespace System.Xml.Query {
-        public class XmlQueryCompileException : XmlQueryException
-        {
+namespace System.Xml.Query
+{
+	public class XmlQueryCompileException : XmlQueryException
+	{
 		#region Constructors
 
-		public XmlQueryCompileException (SerializationInfo info, StreamingContext context)
+		protected XmlQueryCompileException (SerializationInfo info, StreamingContext context)
 			: base (info, context)
 		{
 		}
@@ -39,15 +42,6 @@ namespace System.Xml.Query {
 
 		#endregion // Constructors
 
-		#region Properties
-	
-		[MonoTODO]
-		public override string Message {
-			get { throw new NotImplementedException(); }
-		}
-
-		#endregion // Properties
-
 		#region Methods
 
 		[MonoTODO]
@@ -57,7 +51,7 @@ namespace System.Xml.Query {
 		}
 
 		#endregion // Methods
-        }
+	}
 }
 
 #endif // NET_2_0

+ 6 - 12
mcs/class/System.XML/System.Xml.Query/XmlQueryException.cs

@@ -12,12 +12,13 @@
 using System;
 using System.Runtime.Serialization;
 
-namespace System.Xml.Query {
-        public class XmlQueryException : SystemException
-        {
+namespace System.Xml.Query
+{
+	public class XmlQueryException : SystemException
+	{
 		#region Constructors
 
-		public XmlQueryException (SerializationInfo info, StreamingContext context)
+		protected XmlQueryException (SerializationInfo info, StreamingContext context)
 			: base (info, context)
 		{
 		}
@@ -70,15 +71,8 @@ namespace System.Xml.Query {
 		{
 			throw new NotImplementedException();
 		}
-
-		[MonoTODO]
-		public void SetMessage (string message, bool addLineInfo)
-		{
-			throw new NotImplementedException ();
-		}
-
 		#endregion // Methods
-        }
+	}
 }
 
 #endif // NET_2_0

+ 124 - 0
mcs/class/System.XML/System.Xml.Query/XsltCommand.cs

@@ -0,0 +1,124 @@
+//
+// System.Xml.Query.XsltCommand
+//
+// Author:
+//   Tim Coleman ([email protected])
+//   Atsushi Enomoto ([email protected])
+//
+// Copyright (C) Tim Coleman, 2003
+// Copyright (C) Atsushi Enomoto, 2004
+//
+
+#if NET_2_0
+
+using System.IO;
+using System.Text;
+using System.Xml;
+using System.Xml.XPath;
+
+namespace System.Xml.Query
+{
+	public class XsltCommand
+	{
+		[MonoTODO]
+		public XsltCommand ()
+		{
+		}
+
+		public event QueryEventHandler OnProcessingEvent;
+
+		// Compile
+
+		[MonoTODO]
+		public void Compile (string stylesheetUri, XmlResolver resolver)
+		{ 
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public void Compile (string stylesheetUri)
+		{ 
+			throw new NotImplementedException ();
+		}
+
+		// Execute
+
+		[MonoTODO ("Null args allowed?")]
+		public void Execute (
+			IXPathNavigable contextDocument,
+			XmlWriter results)
+		{
+			Execute (contextDocument, null, null, results);
+		}
+
+		public void Execute (string contextDocumentUri, string resultDocumentUri)
+		{
+			XmlTextWriter xw = new XmlTextWriter (resultDocumentUri, null);
+			try {
+				Execute (new XPathDocument (contextDocumentUri), xw);
+			} finally {
+				xw.Close ();
+			}
+		}
+
+		[MonoTODO]
+		public void Execute (
+			IXPathNavigable contextDocument,
+			XmlArgumentList argList,
+			XmlWriter results)
+		{
+			Execute (contextDocument, null, argList, results);
+		}
+
+		[MonoTODO]
+		public void Execute (
+			XmlResolver dataSources,
+			XmlArgumentList argList,
+			XmlWriter results)
+		{ 
+			Execute (dataSources, argList, results);
+		}
+
+		[MonoTODO]
+		public void Execute (
+			IXPathNavigable contextDocument,
+			XmlResolver dataSources,
+			XmlArgumentList argList,
+			XmlWriter results)
+		{ 
+			throw new NotImplementedException ();
+		}
+
+		public void Execute (
+			string contextDocumentUri, 
+			XmlResolver dataSources, 
+			XmlArgumentList argList, 
+			Stream results)
+		{
+			XmlTextWriter w = new XmlTextWriter (results, null);
+			Execute (contextDocumentUri, dataSources, argList, w);
+		}
+
+		public void Execute (
+			string contextDocumentUri, 
+			XmlResolver dataSources, 
+			XmlArgumentList argList, 
+			TextWriter results)
+		{
+			XmlTextWriter w = new XmlTextWriter (results);
+			Execute (contextDocumentUri, dataSources, argList, w);
+		}
+
+		[MonoTODO]
+		public void Execute (
+			string contextDocumentUri, 
+			XmlResolver dataSources, 
+			XmlArgumentList argList, 
+			XmlWriter results)
+		{
+			throw new NotImplementedException ();
+		}
+	}
+}
+
+#endif // NET_2_0

+ 0 - 71
mcs/class/System.XML/System.Xml.Query/XsltProcessor.cs

@@ -1,71 +0,0 @@
-//
-// System.Xml.Query.XsltProcessor
-//
-// Author:
-//   Tim Coleman ([email protected])
-//
-// Copyright (C) Tim Coleman, 2003
-//
-
-#if NET_2_0
-
-using System.IO;
-
-namespace System.Xml.Query {
-        public class XsltProcessor
-        {
-		#region Constructors
-	
-		[MonoTODO]
-		public XsltProcessor ()
-		{
-		}
-
-		#endregion // Constructors
-
-		#region Properties
-	
-		[MonoTODO]
-		public XmlCommand XmlCommand {
-			get { throw new NotImplementedException (); }
-		}
-
-		#endregion // Properties
-
-		#region Methods
-
-		[MonoTODO]
-		public void Compile (string stylesheetUri, XmlResolver resolver)
-		{ 
-			throw new NotImplementedException ();
-		}
-
-		[MonoTODO]
-		public void Compile (string stylesheetUri)
-		{ 
-			throw new NotImplementedException ();
-		}
-
-		[MonoTODO]
-		public void Execute (string contextDocumentUri, XmlResolver dataSources, XmlQueryArgumentList argList, TextWriter results)
-		{ 
-			throw new NotImplementedException ();
-		}
-
-		[MonoTODO]
-		public void Execute (string contextDocumentUri, XmlResolver dataSources, XmlQueryArgumentList argList, Stream results)
-		{ 
-			throw new NotImplementedException ();
-		}
-
-		[MonoTODO]
-		public void Execute (string contextDocumentUri, string resultDocumentUri)
-		{ 
-			throw new NotImplementedException ();
-		}
-
-		#endregion // Methods
-        }
-}
-
-#endif // NET_2_0