The Labs \ Source Viewer \ SSCLI \ System.Xml.Xsl \ IXsltContextVariable

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XsltContext.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. using System.Collections;
  16. using System.Xml.XPath;
  17. namespace System.Xml.Xsl
  18. {
  19.     public interface IXsltContextFunction
  20.     {
  21.         int Minargs {
  22.             get;
  23.         }
  24.         int Maxargs {
  25.             get;
  26.         }
  27.         XPathResultType ReturnType {
  28.             get;
  29.         }
  30.         XPathResultType[] ArgTypes {
  31.             get;
  32.         }
  33.         object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext);
  34.     }
  35.    
  36.     public interface IXsltContextVariable
  37.     {
  38.         bool IsLocal {
  39.             get;
  40.         }
  41.         bool IsParam {
  42.             get;
  43.         }
  44.         XPathResultType VariableType {
  45.             get;
  46.         }
  47.         object Evaluate(XsltContext xsltContext);
  48.     }
  49.    
  50.     public abstract class XsltContext : XmlNamespaceManager
  51.     {
  52.         protected XsltContext(NameTable table) : base(table)
  53.         {
  54.         }
  55.         protected XsltContext() : base(new NameTable())
  56.         {
  57.         }
  58.         // This dummy XsltContext that doesn't actualy initialize XmlNamespaceManager
  59.         // is used by XsltCompileContext
  60.         internal XsltContext(bool dummy) : base()
  61.         {
  62.         }
  63.         public abstract IXsltContextVariable ResolveVariable(string prefix, string name);
  64.         public abstract IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] ArgTypes);
  65.         public abstract bool Whitespace {
  66.             get;
  67.         }
  68.         public abstract bool PreserveWhitespace(XPathNavigator node);
  69.         public abstract int CompareDocument(string baseUri, string nextbaseUri);
  70.     }
  71. }

Developer Fusion