/// <summary> /// Declare a variable for use by the XPath expression. If the expression /// refers to any variables, then they must be declared here, unless the /// <c>AllowUndeclaredVariables</c> property has been set to true. /// </summary> /// <param name="name">The name of the variable, as a <c>QName</c></param> public void DeclareVariable(QName name) { if (cache != null) { cache.Clear(); } JXPathVariable var = env.declareVariable(name.ToQNameValue()); //declaredVariables.Add(var); }
/// <summary> /// Set the value of a variable /// </summary> public void SetVariable(QName name, XdmValue value) { int slot = env.getSlotNumber(name.ToQNameValue()); if (slot == -1) { throw new ArgumentException("Variable has not been declared: " + name); } variableValues[slot] = value.Unwrap(); }
/// <summary> /// Declare a variable for use by the XPath expression. If the expression /// refers to any variables, then they must be declared here. /// </summary> /// <param name="name">The name of the variable, as a <c>QName</c></param> public void DeclareVariable(QName name) { JXPathVariable var = env.declareVariable(name.ToQNameValue()); declaredVariables.Add(var); }
/// <summary> /// Declare a variable for use by the XPath expression. If the expression /// refers to any variables, then they must be declared here. /// </summary> /// <param name="name">The name of the variable, as a <c>QName</c></param> public void DeclareVariable(QName name) { env.declareVariable(name.ToQNameValue()); }