1 // System.Xml.Xsl.XsltContext
\r
3 // Author: Tim Coleman <tim@timcoleman.com>
\r
4 // (C) Copyright 2002 Tim Coleman
\r
7 // Permission is hereby granted, free of charge, to any person obtaining
\r
8 // a copy of this software and associated documentation files (the
\r
9 // "Software"), to deal in the Software without restriction, including
\r
10 // without limitation the rights to use, copy, modify, merge, publish,
\r
11 // distribute, sublicense, and/or sell copies of the Software, and to
\r
12 // permit persons to whom the Software is furnished to do so, subject to
\r
13 // the following conditions:
\r
15 // The above copyright notice and this permission notice shall be
\r
16 // included in all copies or substantial portions of the Software.
\r
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
19 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
23 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
29 using System.Xml.XPath;
\r
31 namespace System.Xml.Xsl
\r
33 public abstract class XsltContext : XmlNamespaceManager
\r
35 #region Constructors
\r
42 : base (new NameTable ())
\r
51 XsltContext (NameTable table)
\r
60 public abstract bool Whitespace { get; }
\r
61 public abstract bool PreserveWhitespace (XPathNavigator nav);
\r
67 public abstract int CompareDocument (string baseUri, string nextbaseUri);
\r
68 public abstract IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType [] argTypes);
\r
69 public abstract IXsltContextVariable ResolveVariable (string prefix, string name);
\r
73 #region XSLT Internal Calls
\r
75 internal virtual IXsltContextVariable ResolveVariable (XmlQualifiedName name)
\r
77 return ResolveVariable (LookupPrefix (name.Namespace), name.Name);
\r
80 internal virtual IXsltContextFunction ResolveFunction (XmlQualifiedName name, XPathResultType [] argTypes)
\r
82 return ResolveFunction (name.Name, name.Namespace, argTypes);
\r
87 // The static XSLT context, will try to simplify what it can
\r
88 internal interface IStaticXsltContext
\r
90 Expression TryGetVariable (string nm);
\r
91 Expression TryGetFunction (XmlQualifiedName nm, FunctionArguments args);
\r
92 XmlQualifiedName LookupQName (string s);
\r
93 string LookupNamespace (string prefix);
\r