Ejemplo n.º 1
0
            public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
            {
                XsltCompileContext xsltCompileContext = (XsltCompileContext)xsltContext;

                string local, prefix;

                PrefixQName.ParseQualifiedName(ToString(args[0]), out prefix, out local);
                string?          ns      = xsltContext.LookupNamespace(prefix);
                XmlQualifiedName keyName = new XmlQualifiedName(local, ns);

                XPathNavigator root = docContext.Clone();

                root.MoveToRoot();

                ArrayList?resultCollection = null;

                foreach (Key key in xsltCompileContext._processor !.KeyList !)
                {
                    if (key.Name == keyName)
                    {
                        Hashtable?keyTable = key.GetKeys(root);
                        if (keyTable == null)
                        {
                            keyTable = xsltCompileContext.BuildKeyTable(key, root);
                            key.AddKey(root, keyTable);
                        }

                        XPathNodeIterator?it = args[1] as XPathNodeIterator;
                        if (it != null)
                        {
                            it = it.Clone();
                            while (it.MoveNext())
                            {
                                resultCollection = AddToList(resultCollection, (ArrayList?)keyTable[it.Current !.Value]);
Ejemplo n.º 2
0
 private XsltCompileContext GetMatchesContext()
 {
     if (this.matchesContext == null)
     {
         this.matchesContext = new XsltCompileContext();
     }
     return(this.matchesContext);
 }
Ejemplo n.º 3
0
 private XsltCompileContext GetValueOfContext()
 {
     if (this.valueOfContext == null)
     {
         this.valueOfContext = new XsltCompileContext();
     }
     return(this.valueOfContext);
 }
Ejemplo n.º 4
0
        internal Query GetValueQuery(int key, XsltCompileContext context)
        {
            Debug.Assert(key != Compiler.InvalidQueryKey);
            TheQuery theQuery = this.queryStore[key];

            theQuery.CompiledQuery.CheckErrors();
            Query expr = this.queryList[key];

            if (context == null)
            {
                context = new XsltCompileContext(theQuery._ScopeManager, this);
            }
            else
            {
                context.Reinitialize(theQuery._ScopeManager, this);
            }

            expr.SetXsltContext(context);
            return(expr);
        }
Ejemplo n.º 5
0
 private XsltCompileContext GetMatchesContext() {
     if (this.matchesContext == null) {
         this.matchesContext = new XsltCompileContext();
     }
     return this.matchesContext;
 }
Ejemplo n.º 6
0
 private XsltCompileContext GetValueOfContext() {
     if (this.valueOfContext == null) {
         this.valueOfContext = new XsltCompileContext();
     }
     return this.valueOfContext;
 }
Ejemplo n.º 7
0
        internal Query GetValueQuery(int key, XsltCompileContext context) {
            Debug.Assert(key != Compiler.InvalidQueryKey);
            TheQuery theQuery = this.queryStore[key];
            theQuery.CompiledQuery.CheckErrors();
            Query expr = this.queryList[key];

            if (context == null) {
                context = new XsltCompileContext(theQuery._ScopeManager, this);
            } else {
                context.Reinitialize(theQuery._ScopeManager, this);
            }

            expr.SetXsltContext(context);
            return expr;
        }
Ejemplo n.º 8
0
 private XsltCompileContext GetMatchesContext()
 {
     if (_matchesContext == null)
     {
         _matchesContext = new XsltCompileContext();
     }
     return _matchesContext;
 }
Ejemplo n.º 9
0
 private XsltCompileContext GetValueOfContext()
 {
     if (_valueOfContext == null)
     {
         _valueOfContext = new XsltCompileContext();
     }
     return _valueOfContext;
 }