public XsltCompiledContext (XslTransformProcessor p) : base (new NameTable ()) { this.p = p; scopes = new XsltContextInfo [10]; for (int i = 0; i < 10; i++) scopes [i] = new XsltContextInfo (); }
public BaseIterator SortedSelect (XslTransformProcessor p) { if (isSorterContextDependent) { for (int i = 0; i < sorters.Length; i++) if (sorterTemplates [i].IsContextDependent) sorters [i] = sorterTemplates [i].ToXPathSorter (p); } BaseIterator iter = (BaseIterator) p.Select (select); p.PushNodeset (iter); p.PushForEachContext (); ArrayList list = new ArrayList (iter.Count); while (iter.MoveNext ()) { XPathSortElement item = new XPathSortElement (); item.Navigator = iter.Current.Clone (); item.Values = new object [sorters.Length]; for (int i = 0; i < sorters.Length; i++) item.Values [i] = sorters [i].Evaluate (iter); list.Add (item); } p.PopForEachContext (); p.PopNodeset (); sortRunner.CopyFrom (sorters); return sortRunner.Sort (list, iter.NamespaceManager); }
public XsltCompiledContext(XslTransformProcessor p) : base(new NameTable()) { this.p = p; this.scopes = new XsltCompiledContext.XsltContextInfo[10]; for (int i = 0; i < 10; i++) { this.scopes[i] = new XsltCompiledContext.XsltContextInfo(); } }
public XPathSorter ToXPathSorter(XslTransformProcessor p) { return(new XPathSorter(expr, orderAvt == null ? order : ParseOrder(orderAvt.Evaluate(p)), caseOrderAvt == null ? caseOrder: ParseCaseOrder(caseOrderAvt.Evaluate(p)), langAvt == null ? lang : ParseLang(langAvt.Evaluate(p)), dataTypeAvt == null ? dataType : ParseDataType(dataTypeAvt.Evaluate(p)) )); }
public void DebugExecute(XslTransformProcessor p, XPathNavigator style) { this.on_execute.Invoke(this.impl, new object[] { p.CurrentNodeset.Clone(), style.Clone(), p.XPathContext }); }
public void AddToExpr(XPathExpression e, XslTransformProcessor p) { e.AddSort( expr, orderAvt == null ? order : ParseOrder(orderAvt.Evaluate(p)), caseOrderAvt == null ? caseOrder: ParseCaseOrder(caseOrderAvt.Evaluate(p)), langAvt == null ? lang : ParseLang(langAvt.Evaluate(p)), dataTypeAvt == null ? dataType : ParseDataType(dataTypeAvt.Evaluate(p)) ); }
public override void Evaluate(XslTransformProcessor p, Hashtable withParams) { if (p.CurrentNode.NodeType == XPathNodeType.Whitespace) { if (p.PreserveOutputWhitespace) { p.Out.WriteWhitespace(p.CurrentNode.Value); } } else { p.Out.WriteString(p.CurrentNode.Value); } }
public XslLocalVariable Resolve(XslTransformProcessor p, XmlQualifiedName name) { for (VariableScope variableScope = this; variableScope != null; variableScope = variableScope.Parent) { if (variableScope.variables != null) { XslLocalVariable xslLocalVariable = variableScope.variables[name] as XslLocalVariable; if (xslLocalVariable != null && xslLocalVariable.IsEvaluated(p)) { return(xslLocalVariable); } } } return(null); }
private Uri Resolve(string thisUri, string baseUri, XslTransformProcessor p) { XmlResolver resolver = p.Resolver; if (resolver == null) { return(null); } Uri baseUri2 = null; if (!object.ReferenceEquals(baseUri, XsltDocument.VoidBaseUriFlag) && baseUri != string.Empty) { baseUri2 = resolver.ResolveUri(null, baseUri); } return(resolver.ResolveUri(baseUri2, thisUri)); }
public XslLocalVariable Resolve(XslTransformProcessor p, QName name) { for (VariableScope s = this; s != null; s = s.Parent) { if (s.variables == null) { continue; } XslLocalVariable v = s.variables [name] as XslLocalVariable; if (v != null && v.IsEvaluated(p)) { return(v); } } return(null); }
void EvaluateCore(XslTransformProcessor p, Hashtable withParams) { if (XslTransform.TemplateStackFrameOutput != null) { XslTransform.TemplateStackFrameOutput.WriteLine(LocationMessage); } p.PushStack(stackSize); if (parameters != null) { if (withParams == null) { int len = parameters.Count; for (int i = 0; i < len; i++) { XslLocalParam param = (XslLocalParam)parameters [i]; param.Evaluate(p); } } else { int len = parameters.Count; for (int i = 0; i < len; i++) { XslLocalParam param = (XslLocalParam)parameters [i]; object o = withParams [param.Name]; if (o != null) { param.Override(p, o); } else { param.Evaluate(p); } } } } if (content != null) { content.Evaluate(p); } p.PopStack(); }
public XslTemplate FindMatch(XPathNavigator node, XslTransformProcessor p) { if (!this.sorted) { this.unnamedTemplates.Sort(); this.unnamedTemplates.Reverse(); this.sorted = true; } for (int i = 0; i < this.unnamedTemplates.Count; i++) { XslModedTemplateTable.TemplateWithPriority templateWithPriority = (XslModedTemplateTable.TemplateWithPriority) this.unnamedTemplates[i]; if (templateWithPriority.Matches(node, p)) { return(templateWithPriority.Template); } } return(null); }
Uri Resolve(string thisUri, string baseUri, XslTransformProcessor p) { // Debug.WriteLine ("THIS: " + thisUri); // Debug.WriteLine ("BASE: " + baseUri); XmlResolver r = p.Resolver; if (r == null) { return(null); } Uri uriBase = null; if (!object.ReferenceEquals(baseUri, VoidBaseUriFlag) && baseUri != String.Empty) { uriBase = r.ResolveUri(null, baseUri); } return(r.ResolveUri(uriBase, thisUri)); }
private void EvaluateCore(XslTransformProcessor p, Hashtable withParams) { if (XslTransform.TemplateStackFrameOutput != null) { XslTransform.TemplateStackFrameOutput.WriteLine(this.LocationMessage); } p.PushStack(this.stackSize); if (this.parameters != null) { if (withParams == null) { int count = this.parameters.Count; for (int i = 0; i < count; i++) { XslLocalParam xslLocalParam = (XslLocalParam)this.parameters[i]; xslLocalParam.Evaluate(p); } } else { int count2 = this.parameters.Count; for (int j = 0; j < count2; j++) { XslLocalParam xslLocalParam2 = (XslLocalParam)this.parameters[j]; object obj = withParams[xslLocalParam2.Name]; if (obj != null) { xslLocalParam2.Override(p, obj); } else { xslLocalParam2.Evaluate(p); } } } } if (this.content != null) { this.content.Evaluate(p); } p.PopStack(); }
public XslTemplate FindMatch(XPathNavigator node, XmlQualifiedName mode, XslTransformProcessor p) { if (this[mode] != null) { XslTemplate xslTemplate = this[mode].FindMatch(node, p); if (xslTemplate != null) { return(xslTemplate); } } for (int i = this.parent.Imports.Count - 1; i >= 0; i--) { XslStylesheet xslStylesheet = (XslStylesheet)this.parent.Imports[i]; XslTemplate xslTemplate = xslStylesheet.Templates.FindMatch(node, mode, p); if (xslTemplate != null) { return(xslTemplate); } } return(null); }
public XslTemplate FindMatch(XPathNavigator node, XslTransformProcessor p) { //Debug.WriteLine ("..."); if (!sorted) { unnamedTemplates.Sort(); unnamedTemplates.Reverse(); sorted = true; } for (int i = 0; i < unnamedTemplates.Count; i++) { TemplateWithPriority t = (TemplateWithPriority)unnamedTemplates [i]; if (t.Matches(node, p)) { return(t.Template); } } return(null); }
public virtual void Evaluate(XslTransformProcessor p, Hashtable withParams) { if (XslTransform.TemplateStackFrameError) { try { EvaluateCore(p, withParams); } catch (XsltException ex) { AppendTemplateFrame(ex); throw ex; } catch (Exception ex) { // Note that this catch causes different // type of error to be thrown (esp. // this causes NUnit test regression). XsltException e = new XsltException("Error during XSLT processing: ", null, p.CurrentNode); AppendTemplateFrame(e); throw e; } } else { EvaluateCore(p, withParams); } }
public bool Matches(XPathNavigator n, XslTransformProcessor p) { //Debug.WriteLine (Pattern.ToString ()); return(p.Matches(Pattern, n)); }
public virtual void Evaluate (XslTransformProcessor p, Hashtable withParams) { if (XslTransform.TemplateStackFrameError) { try { EvaluateCore (p, withParams); } catch (XsltException ex) { AppendTemplateFrame (ex); throw ex; } catch (Exception) { // Note that this catch causes different // type of error to be thrown (esp. // this causes NUnit test regression). XsltException e = new XsltException ("Error during XSLT processing: ", null, p.CurrentNode); AppendTemplateFrame (e); throw e; } } else EvaluateCore (p, withParams); }
public override void Evaluate(XslTransformProcessor p, Hashtable withParams) { p.ApplyTemplates(p.CurrentNode.SelectChildren(XPathNodeType.All), mode, null); }
public void Evaluate(XslTransformProcessor p) { Evaluate(p, null); }
void EvaluateCore (XslTransformProcessor p, Hashtable withParams) { if (XslTransform.TemplateStackFrameOutput != null) XslTransform.TemplateStackFrameOutput.WriteLine (LocationMessage); p.PushStack (stackSize); if (parameters != null) { if (withParams == null) { int len = parameters.Count; for (int i = 0; i < len; i++) { XslLocalParam param = (XslLocalParam)parameters [i]; param.Evaluate (p); } } else { int len = parameters.Count; for (int i = 0; i < len; i++) { XslLocalParam param = (XslLocalParam)parameters [i]; object o = withParams [param.Name]; if (o != null) param.Override (p, o); else param.Evaluate (p); } } } if (content != null) content.Evaluate (p); p.PopStack (); }
public override void Evaluate (XslTransformProcessor p, Hashtable withParams) { if (p.CurrentNode.NodeType == XPathNodeType.Whitespace) { if (p.PreserveOutputWhitespace) p.Out.WriteWhitespace (p.CurrentNode.Value); } else p.Out.WriteString (p.CurrentNode.Value); }
public override void Evaluate (XslTransformProcessor p) { p.SetBusy (this); if (usedAttributeSets != null) { for (int i = 0; i < usedAttributeSets.Count; i++) { QName set = (QName) usedAttributeSets [i]; XslAttributeSet s = p.ResolveAttributeSet (set); if (s == null) throw new XsltException ("Could not resolve attribute set", null, p.CurrentNode); if (p.IsBusy (s)) throw new XsltException ("circular dependency", null, p.CurrentNode); s.Evaluate (p); } } for (int i = 0; i < attributes.Count; i++) ((XslAttribute) attributes [i]).Evaluate (p); p.SetFree (this); }
public void DebugExecute (XslTransformProcessor p, XPathNavigator style) { on_execute.Invoke (impl, new object [] {p.CurrentNodeset.Clone (), style.Clone (), p.XPathContext}); }
public XPathSorter ToXPathSorter (XslTransformProcessor p) { return new XPathSorter (expr, orderAvt == null ? order : ParseOrder (orderAvt.Evaluate (p)), caseOrderAvt == null ? caseOrder: ParseCaseOrder (caseOrderAvt.Evaluate (p)), langAvt == null ? lang : ParseLang (langAvt.Evaluate (p)), dataTypeAvt == null ? dataType : ParseDataType (dataTypeAvt.Evaluate (p)) ); }
public void AddToExpr (XPathExpression e, XslTransformProcessor p) { e.AddSort ( expr, orderAvt == null ? order : ParseOrder (orderAvt.Evaluate (p)), caseOrderAvt == null ? caseOrder: ParseCaseOrder (caseOrderAvt.Evaluate (p)), langAvt == null ? lang : ParseLang (langAvt.Evaluate (p)), dataTypeAvt == null ? dataType : ParseDataType (dataTypeAvt.Evaluate (p)) ); }
public XPathSorter ToXPathSorter(XslTransformProcessor p) { return(new XPathSorter(this.expr, (this.orderAvt != null) ? this.ParseOrder(this.orderAvt.Evaluate(p)) : this.order, (this.caseOrderAvt != null) ? this.ParseCaseOrder(this.caseOrderAvt.Evaluate(p)) : this.caseOrder, (this.langAvt != null) ? this.ParseLang(this.langAvt.Evaluate(p)) : this.lang, (this.dataTypeAvt != null) ? this.ParseDataType(this.dataTypeAvt.Evaluate(p)) : this.dataType)); }
public override void Evaluate (XslTransformProcessor p, Hashtable withParams) { p.ApplyTemplates (p.CurrentNode.SelectChildren (XPathNodeType.All), mode, null); }
public override void Evaluate (XslTransformProcessor p, Hashtable withParams) { }
public XslTemplate FindMatch (XPathNavigator node, XmlQualifiedName mode, XslTransformProcessor p) { XslTemplate ret; if (this [mode] != null) { ret = this [mode].FindMatch (node, p); if (ret != null) return ret; } for (int i = parent.Imports.Count - 1; i >= 0; i--) { XslStylesheet s = (XslStylesheet)parent.Imports [i]; ret = s.Templates.FindMatch (node, mode, p); if (ret != null) return ret; } return null; }
public XslTemplate FindMatch (XPathNavigator node, XslTransformProcessor p) { //Debug.WriteLine ("..."); if (!sorted) { unnamedTemplates.Sort (); unnamedTemplates.Reverse (); sorted = true; } for (int i = 0; i < unnamedTemplates.Count; i++) { TemplateWithPriority t = (TemplateWithPriority) unnamedTemplates [i]; if (t.Matches (node, p)) return t.Template; } return null; }
public void Evaluate (XslTransformProcessor p) { Evaluate (p, null); }
Uri Resolve (string thisUri, string baseUri, XslTransformProcessor p) { // Debug.WriteLine ("THIS: " + thisUri); // Debug.WriteLine ("BASE: " + baseUri); XmlResolver r = p.Resolver; if (r == null) return null; Uri uriBase = null; if (! object.ReferenceEquals (baseUri, VoidBaseUriFlag) && baseUri != String.Empty) uriBase = r.ResolveUri (null, baseUri); return r.ResolveUri (uriBase, thisUri); }
public bool Matches (XPathNavigator n, XslTransformProcessor p) { //Debug.WriteLine (Pattern.ToString ()); return p.Matches (Pattern, n); }
public bool Matches(XPathNavigator n, XslTransformProcessor p) { return(p.Matches(this.Pattern, n)); }
public XslLocalVariable Resolve (XslTransformProcessor p, QName name) { for (VariableScope s = this; s != null; s = s.Parent) { if (s.variables == null) continue; XslLocalVariable v = s.variables [name] as XslLocalVariable; if (v != null && v.IsEvaluated (p)) return v; } return null; }
public override void Evaluate(XslTransformProcessor p, Hashtable withParams) { }
public void AddToExpr(XPathExpression e, XslTransformProcessor p) { e.AddSort(this.expr, (this.orderAvt != null) ? this.ParseOrder(this.orderAvt.Evaluate(p)) : this.order, (this.caseOrderAvt != null) ? this.ParseCaseOrder(this.caseOrderAvt.Evaluate(p)) : this.caseOrder, (this.langAvt != null) ? this.ParseLang(this.langAvt.Evaluate(p)) : this.lang, (this.dataTypeAvt != null) ? this.ParseDataType(this.dataTypeAvt.Evaluate(p)) : this.dataType); }