XsltContext.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // System.Xml.Xsl.XsltContext
  2. //
  3. // Author: Tim Coleman <[email protected]>
  4. // (C) Copyright 2002 Tim Coleman
  5. using System;
  6. using System.Xml;
  7. using System.Xml.XPath;
  8. namespace System.Xml.Xsl
  9. {
  10. public abstract class XsltContext : XmlNamespaceManager
  11. {
  12. #region Constructors
  13. public XsltContext () {}
  14. public XsltContext (NameTable table)
  15. : base (table)
  16. {
  17. }
  18. #endregion
  19. #region Properties
  20. public abstract bool Whitespace { get; }
  21. public abstract bool PreserveWhitespace (XPathNavigator nav);
  22. #endregion
  23. #region Methods
  24. public abstract int CompareDocument (string baseUri, string nextbaseUri);
  25. public abstract IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType [] ArgTypes);
  26. public abstract IXsltContextVariable ResolveVariable (string prefix, string name);
  27. #endregion
  28. #region XSLT Internal Calls
  29. internal virtual IXsltContextVariable ResolveVariable (XmlQualifiedName name)
  30. {
  31. throw new InvalidOperationException ("somehow you got into the internals of xslt!?");
  32. }
  33. internal virtual IXsltContextFunction ResolveFunction (XmlQualifiedName name, XPathResultType [] ArgTypes)
  34. {
  35. throw new InvalidOperationException ("somehow you got into the internals of xslt!?");
  36. }
  37. #endregion
  38. }
  39. // The static XSLT context, will try to simplify what it can
  40. internal interface IStaticXsltContext
  41. {
  42. Expression TryGetVariable (string nm);
  43. Expression TryGetFunction (XmlQualifiedName nm, FunctionArguments args);
  44. XmlQualifiedName LookupQName (string s);
  45. XmlNamespaceManager GetNsm ();
  46. }
  47. }