From: Oleg T. <he...@us...> - 2005-10-16 16:51:38
|
Update of /cvsroot/mvp-xml/Common/v1/src/XPath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3371/v2/src/XPath Modified Files: DynamicContext.cs IndexingXPathNavigator.cs SubtreeeXPathNavigator.cs XPathCache.cs XPathIteratorReader.cs Log Message: Index: SubtreeeXPathNavigator.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/src/XPath/SubtreeeXPathNavigator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SubtreeeXPathNavigator.cs 28 May 2005 20:14:41 -0000 1.2 +++ SubtreeeXPathNavigator.cs 16 Oct 2005 16:51:24 -0000 1.3 @@ -176,7 +176,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.Value"/>. + /// See <see cref="XPathItem.Value"/>. /// </summary> public override string Value { @@ -276,7 +276,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.MoveToNext"/>. + /// See <see cref="XPathNavigator.MoveToNext()"/>. /// </summary> public override bool MoveToNext() { @@ -401,7 +401,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.MoveToFirstNamespace"/>. + /// See <see cref="XPathNavigator.MoveToFirstNamespace(XPathNamespaceScope)"/>. /// </summary> public override bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope) { @@ -409,7 +409,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.MoveToNextNamespace"/>. + /// See <see cref="XPathNavigator.MoveToNextNamespace(XPathNamespaceScope)"/>. /// </summary> public override bool MoveToNextNamespace(XPathNamespaceScope namespaceScope) { Index: XPathCache.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/src/XPath/XPathCache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- XPathCache.cs 28 May 2005 20:14:41 -0000 1.3 +++ XPathCache.cs 16 Oct 2005 16:51:24 -0000 1.4 @@ -319,7 +319,7 @@ /// Selects a node set using the specified XPath expression and sort. /// </summary> /// <remarks> - /// See <see cref="XPathExpression.AddSort"/>. + /// See <see cref="XPathExpression.AddSort(object, IComparer)"/>. /// </remarks> public static XPathNodeIterator SelectSorted(string expression, XPathNavigator source, object sortExpression, IComparer comparer) @@ -333,7 +333,7 @@ /// Selects a node set using the specified XPath expression and sort. /// </summary> /// <remarks> - /// See <see cref="XPathExpression.AddSort"/>. + /// See <see cref="XPathExpression.AddSort(object, IComparer)"/>. /// </remarks> public static XPathNodeIterator SelectSorted(string expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType ) @@ -531,7 +531,7 @@ /// Selects a node set using the specified XPath expression and sort. /// </summary> /// <remarks> - /// See <see cref="XPathExpression.AddSort"/>. + /// See <see cref="XPathExpression.AddSort(object, IComparer)"/>. /// </remarks> public static XmlNodeList SelectNodesSorted(string expression, XmlNode source, object sortExpression, IComparer comparer) @@ -544,7 +544,7 @@ /// Selects a node set using the specified XPath expression and sort. /// </summary> /// <remarks> - /// See <see cref="XPathExpression.AddSort"/>. + /// See <see cref="XPathExpression.AddSort(object, IComparer)"/>. /// </remarks> public static XmlNodeList SelectNodesSorted(string expression, XmlNode source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType ) Index: XPathIteratorReader.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/src/XPath/XPathIteratorReader.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- XPathIteratorReader.cs 28 May 2005 20:14:41 -0000 1.2 +++ XPathIteratorReader.cs 16 Oct 2005 16:51:24 -0000 1.3 @@ -143,19 +143,19 @@ get { return _current.IsEmptyElement; } } - /// <summary>See <see cref="XmlReader.this"/></summary> + /// <summary>See <see cref="XmlReader.this[string, string]"/></summary> public override string this[string name, string ns] { get { return _current[name, ns]; } } - /// <summary>See <see cref="XmlReader.this"/></summary> + /// <summary>See <see cref="XmlReader.this[string]"/></summary> public override string this[string name] { get { return _current[name, String.Empty]; } } - /// <summary>See <see cref="XmlReader.this"/></summary> + /// <summary>See <see cref="XmlReader.this[int]"/></summary> public override string this[int i] { get { return _current[i]; } @@ -238,19 +238,19 @@ _current.Close(); } - /// <summary>See <see cref="XmlReader.GetAttribute"/></summary> + /// <summary>See <see cref="XmlReader.GetAttribute(string, string)"/></summary> public override string GetAttribute(string name, string ns) { return _current.GetAttribute(name, ns); } - /// <summary>See <see cref="XmlReader.GetAttribute"/></summary> + /// <summary>See <see cref="XmlReader.GetAttribute(string)"/></summary> public override string GetAttribute(string name) { return _current.GetAttribute(name); } - /// <summary>See <see cref="XmlReader.GetAttribute"/></summary> + /// <summary>See <see cref="XmlReader.GetAttribute(int)"/></summary> public override string GetAttribute(int i) { return _current.GetAttribute(i); @@ -262,19 +262,19 @@ return _current.LookupNamespace(prefix); } - /// <summary>See <see cref="XmlReader.MoveToAttribute"/></summary> + /// <summary>See <see cref="XmlReader.MoveToAttribute(string, string)"/></summary> public override bool MoveToAttribute(string name, string ns) { return _current.MoveToAttribute(name, ns); } - /// <summary>See <see cref="XmlReader.MoveToAttribute"/></summary> + /// <summary>See <see cref="XmlReader.MoveToAttribute(string)"/></summary> public override bool MoveToAttribute(string name) { return _current.MoveToAttribute(name); } - /// <summary>See <see cref="XmlReader.MoveToAttribute"/></summary> + /// <summary>See <see cref="XmlReader.MoveToAttribute(int)"/></summary> public override void MoveToAttribute(int i) { _current.MoveToAttribute(i); @@ -318,7 +318,7 @@ if (read) { // Just move to the next node and create the reader. - _current = new XPathNavigatorReader(_iterator.Current); + _current = _iterator.Current.ReadSubtree(); return _current.Read(); } else @@ -464,20 +464,20 @@ { get { return false; } } - - /// <summary>See <see cref="XmlReader.this"/></summary> + + /// <summary>See <see cref="XmlReader.this[string, string]"/></summary> public override string this[string name, string ns] { get { return null; } } - /// <summary>See <see cref="XmlReader.this"/></summary> + /// <summary>See <see cref="XmlReader.this[string]"/></summary> public override string this[string name] { get { return null; } } - /// <summary>See <see cref="XmlReader.this"/></summary> + /// <summary>See <see cref="XmlReader.this[string]"/></summary> public override string this[int i] { get { return null; } @@ -559,19 +559,19 @@ _state = ReadState.Closed; } - /// <summary>See <see cref="XmlReader.GetAttribute"/></summary> + /// <summary>See <see cref="XmlReader.GetAttribute(string, string)"/></summary> public override string GetAttribute(string name, string ns) { return null; } - /// <summary>See <see cref="XmlReader.GetAttribute"/></summary> + /// <summary>See <see cref="XmlReader.GetAttribute(string)"/></summary> public override string GetAttribute(string name) { return null; } - /// <summary>See <see cref="XmlReader.GetAttribute"/></summary> + /// <summary>See <see cref="XmlReader.GetAttribute(int)"/></summary> public override string GetAttribute(int i) { return null; @@ -583,19 +583,19 @@ return null; } - /// <summary>See <see cref="XmlReader.MoveToAttribute"/></summary> + /// <summary>See <see cref="XmlReader.MoveToAttribute(string, string)"/></summary> public override bool MoveToAttribute(string name, string ns) { return false; } - /// <summary>See <see cref="XmlReader.MoveToAttribute"/></summary> + /// <summary>See <see cref="XmlReader.MoveToAttribute(string)"/></summary> public override bool MoveToAttribute(string name) { return false; } - /// <summary>See <see cref="XmlReader.MoveToAttribute"/></summary> + /// <summary>See <see cref="XmlReader.MoveToAttribute(int)"/></summary> public override void MoveToAttribute(int i) { } Index: IndexingXPathNavigator.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/src/XPath/IndexingXPathNavigator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- IndexingXPathNavigator.cs 28 May 2005 20:14:41 -0000 1.2 +++ IndexingXPathNavigator.cs 16 Oct 2005 16:51:24 -0000 1.3 @@ -1,7 +1,7 @@ #region using using System; -using System.Collections; +using System.Collections.Generic; using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; @@ -150,7 +150,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.Value"/>. + /// See <see cref="XPathItem.Value"/>. /// </summary> public override string Value { @@ -246,7 +246,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.MoveToFirstNamespace"/>. + /// See <see cref="XPathNavigator.MoveToFirstNamespace(XPathNamespaceScope)"/>. /// </summary> public override bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope) { @@ -254,7 +254,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.MoveToNextNamespace"/>. + /// See <see cref="XPathNavigator.MoveToNextNamespace(XPathNamespaceScope)"/>. /// </summary> public override bool MoveToNextNamespace(XPathNamespaceScope namespaceScope) { @@ -262,7 +262,7 @@ } /// <summary> - /// See <see cref="XPathNavigator.MoveToNext"/>. + /// See <see cref="XPathNavigator.MoveToNext()"/>. /// </summary> public override bool MoveToNext() { @@ -585,8 +585,8 @@ /// </summary> private class XPathNavigatorIndex { - private ArrayList keys; - private Hashtable index; + private IList<KeyDef> keys; + private IDictionary<string, List<XPathNavigator>> index; private Type arrayIteratorType; /// <summary> @@ -594,8 +594,8 @@ /// </summary> public XPathNavigatorIndex() { - keys = new ArrayList(); - index = new Hashtable(); + keys = new List<KeyDef>(); + index = new Dictionary<string, List<XPathNavigator>>(); Assembly systemXml = typeof(XPathNodeIterator).Assembly; // TODO: is there another way? arrayIteratorType = systemXml.GetType("System.Xml.XPath.XPathArrayIterator"); @@ -624,27 +624,27 @@ //converted to a string as if by a call to the string function; it //returns a node-set containing the nodes in the same document as //the context node that have a value for the named key equal to this string. - ArrayList indexedNodes = null; + List<XPathNavigator> indexedNodes = null; if (keyValue is XPathNodeIterator) { XPathNodeIterator nodes = keyValue as XPathNodeIterator; while (nodes.MoveNext()) - { - ArrayList chunkOfIndexedNodes = (ArrayList)index[nodes.Current.Value]; + { + IList<XPathNavigator> chunkOfIndexedNodes = index[nodes.Current.Value]; if (chunkOfIndexedNodes != null) { if (indexedNodes == null) - indexedNodes = new ArrayList(); + indexedNodes = new List<XPathNavigator>(); indexedNodes.AddRange(chunkOfIndexedNodes); } } } else { - indexedNodes = (ArrayList)index[keyValue.ToString()]; + indexedNodes = index[keyValue.ToString()]; } if (indexedNodes == null) - indexedNodes = new ArrayList(0); + indexedNodes = new List<XPathNavigator>(0); return (XPathNodeIterator) Activator.CreateInstance( arrayIteratorType, BindingFlags.Instance | BindingFlags.Public | @@ -691,10 +691,10 @@ private void AddNodeToIndex(XPathNavigator node, string key) { //Get slot - ArrayList indexedNodes = (ArrayList)index[key]; + List<XPathNavigator> indexedNodes = index[key]; if (indexedNodes == null) { - indexedNodes = new ArrayList(); + indexedNodes = new List<XPathNavigator>(); index.Add(key, indexedNodes); } indexedNodes.Add(node.Clone()); @@ -710,7 +710,7 @@ /// </summary> private class XPathNavigatorIndexManager { - private Hashtable indexes; + private IDictionary<string, XPathNavigatorIndex> indexes; private XPathNavigator nav; private bool indexed; @@ -726,8 +726,8 @@ this.nav = nav; //Named indexes are stored in a hashtable. if (indexes == null) - indexes = new Hashtable(); - XPathNavigatorIndex index = (XPathNavigatorIndex)indexes[indexName]; + indexes = new Dictionary<string, XPathNavigatorIndex>(); + XPathNavigatorIndex index = indexes[indexName]; if (index == null) { index = new XPathNavigatorIndex(); @@ -790,7 +790,7 @@ { if (!indexed) BuildIndexes(); - XPathNavigatorIndex index = (XPathNavigatorIndex)indexes[indexName]; + XPathNavigatorIndex index = indexes[indexName]; return index == null? null : index.GetNodes(value); } } Index: DynamicContext.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/src/XPath/DynamicContext.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DynamicContext.cs 28 May 2005 20:14:41 -0000 1.2 +++ DynamicContext.cs 16 Oct 2005 16:51:24 -0000 1.3 @@ -1,7 +1,7 @@ #region using using System; -using System.Collections; +using System.Collections.Generic; using System.Reflection; using System.Text; using System.Xml; @@ -25,7 +25,7 @@ { #region Private vars - Hashtable _variables = new Hashtable(); + IDictionary<string, DynamicVariable> _variables = new Dictionary<string, DynamicVariable>(); #endregion Private @@ -84,7 +84,7 @@ #region Common Overrides /// <summary> - /// Implementation equal to <see cref="XsltCompileContext"/>. + /// Implementation equal to <see cref="XsltContext.CompareDocument(string, string)"/>. /// </summary> public override int CompareDocument(string baseUri, string nextbaseUri) { @@ -116,7 +116,7 @@ } /// <summary> - /// Same as <see cref="XsltCompileContext"/>. + /// Same as <see cref="XsltContext.PreserveWhitespace(XPathNavigator)"/>. /// </summary> public override bool PreserveWhitespace(XPathNavigator node) { @@ -124,7 +124,7 @@ } /// <summary> - /// Same as <see cref="XsltCompileContext"/>. + /// Same as <see cref="XsltContext.Whitespace"/>. /// </summary> public override bool Whitespace { |