Пример #1
0
        private XPathExpression GetCompiledExpression(SifXPathExpression expression)
        {
            XPathExpression returnValue = expression.CompiledExpression;

            if (returnValue == null)
            {
                returnValue = fDefaultNavigator.Compile(expression.Expression);
                expression.CompiledExpression = returnValue;
            }
            return(returnValue);
        }
Пример #2
0
 /// <summary>
 /// Evaluates the xpath and returns the resulting object. Primitive types are wrapped into objects.
 /// </summary>
 /// <param name="expression"></param>
 /// <returns></returns>
 public object GetValue(SifXPathExpression expression)
 {
     return(GetValue(GetCompiledExpression(expression)));
 }
Пример #3
0
 internal INodePointer CreatePath(SifXPathExpression sifXPathExpression)
 {
     return(CreatePath(sifXPathExpression.Expression));
 }
Пример #4
0
        private void Compile()
        {
            // If there is a value assignment in the rule, chop it off
            String sqp = fDef;
            int lastEqualsSign = fDef.LastIndexOf("=");
            if (lastEqualsSign > -1)
            {
                int lastBracket = fDef.LastIndexOf("]");
                if (lastBracket < lastEqualsSign)
                {
                    sqp = fDef.Substring(0, lastEqualsSign);
                    fValueIndex = lastEqualsSign + 1;
                }
            }

            fExpression = SifXPathContext.Compile(sqp);
        }
Пример #5
0
 private XPathExpression GetCompiledExpression( SifXPathExpression expression )
 {
     XPathExpression returnValue = expression.CompiledExpression;
     if ( returnValue == null )
     {
         returnValue = fDefaultNavigator.Compile( expression.Expression );
         expression.CompiledExpression = returnValue;
     }
     return returnValue;
 }
Пример #6
0
 internal INodePointer CreatePath( SifXPathExpression sifXPathExpression )
 {
     return CreatePath( sifXPathExpression.Expression );
 }
Пример #7
0
 /// <summary>
 /// Evaluates the xpath and returns the resulting object. Primitive types are wrapped into objects.
 /// </summary>
 /// <param name="expression"></param>
 /// <returns></returns>
 public object GetValue( SifXPathExpression expression )
 {
     return GetValue( GetCompiledExpression( expression ) );
 }