XsltContext.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. : base (new NameTable ())
  15. {
  16. }
  17. public XsltContext (NameTable table)
  18. : base (table)
  19. {
  20. }
  21. #endregion
  22. #region Properties
  23. public abstract bool Whitespace { get; }
  24. public abstract bool PreserveWhitespace (XPathNavigator nav);
  25. #endregion
  26. #region Methods
  27. public abstract int CompareDocument (string baseUri, string nextbaseUri);
  28. public abstract IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType [] ArgTypes);
  29. public abstract IXsltContextVariable ResolveVariable (string prefix, string name);
  30. #endregion
  31. #region XSLT Internal Calls
  32. internal virtual IXsltContextVariable ResolveVariable (XmlQualifiedName name)
  33. {
  34. throw new InvalidOperationException ("somehow you got into the internals of xslt!?");
  35. }
  36. internal virtual IXsltContextFunction ResolveFunction (XmlQualifiedName name, XPathResultType [] ArgTypes)
  37. {
  38. throw new InvalidOperationException ("somehow you got into the internals of xslt!?");
  39. }
  40. #endregion
  41. }
  42. // The static XSLT context, will try to simplify what it can
  43. internal interface IStaticXsltContext
  44. {
  45. Expression TryGetVariable (string nm);
  46. Expression TryGetFunction (XmlQualifiedName nm, FunctionArguments args);
  47. XmlQualifiedName LookupQName (string s);
  48. XmlNamespaceManager GetNsm ();
  49. }
  50. }