Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Value


            ExpressionFactory factory = ExpressionFactory.getDefaultInstance();
            ExpressionParser parser = factory.createExpressionParser();
            try {
                // Parse, and evaluate the expression.
                Expression expression = parser.parse(expr);
                Value value = expression.evaluate(context);

                // Stream the value's contents into the process following the
                // dynamic process. Don't do it into the dynamic process as
                // that will cause any markup to get reevaluated.
                value.streamContents(getTargetProcess(dynamicProcess));

            } catch (ExpressionException e) {
                dynamicProcess.fatalError(new XMLPipelineException(
                        "Error parsing '" + expr +
                        "' from expr attribute on " + element,
View Full Code Here


                        new ImmutableExpandedName("", "myVar"),
                        seq);

        Expression exp = compileExpression("boolean($myVar)");

        Value result = exp.evaluate(context);

        assertTrue("fn:boolean should result in a boolean value",
                   result instanceof BooleanValue);

        assertTrue("fn:boolean expression result should be true",
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testBooleanNumericArg() throws Exception {
        Expression exp = compileExpression("boolean(0.0)");

        Value result = exp.evaluate(context);

        assertTrue("fn:boolean should result in a boolean value",
                   result instanceof BooleanValue);

        assertFalse("fn:boolean expression result should be false",
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testNumberNumericArg() throws Exception {
        Expression exp = compileExpression("number(0.0)");

        Value result = exp.evaluate(context);

        assertTrue("fn:number should result in a double value",
                   result instanceof DoubleValue);

        assertEquals("fn:number expression result should be 0.0",
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testNumberStringArg() throws Exception {
        Expression exp = compileExpression("number('99.9')");

        Value result = exp.evaluate(context);

        assertTrue("fn:number should result in a double value",
                   result instanceof DoubleValue);

        assertEquals("fn:number expression result should be 99.9",
View Full Code Here

    public Value invoke(ExpressionContext context, Value[] arguments) throws ExpressionException {
        assertArgumentCount(arguments, 0);
        SAXParseException x = getException(context);
        ExpressionFactory factory = context.getFactory();
        Value result = Sequence.EMPTY;

        if (x instanceof XMLPipelineException) {
            XMLPipelineException pipelineException = (XMLPipelineException) x;
            String sourceID = pipelineException.getErrorSourceID();
            if (sourceID != null) {
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testNumberBooleanArg() throws Exception {
        Expression exp = compileExpression("number(true())");

        Value result = exp.evaluate(context);

        assertTrue("fn:number should result in a double value",
                   result instanceof DoubleValue);

        assertEquals("fn:number expression result should be 1.0",
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testNumberInvalidArg() throws Exception {
        Expression exp = compileExpression("number('one')");

        Value result = exp.evaluate(context);

        assertTrue("fn:number should result in a Double value",
                   result instanceof DoubleValue);

        assertTrue("fn:number expression result should be NaN",
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testConcatTwoStringArgs() throws Exception {
        Expression exp = compileExpression("concat('con', 'cat')");

        Value result = exp.evaluate(context);

        assertTrue("fn:concat should result in a String value",
                   result instanceof StringValue);

        assertEquals("fn:concat expression result should be concat",
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testConcatFiveStringArgs() throws Exception {
        Expression exp = compileExpression("concat('ex','pres','s','ion','s')");

        Value result = exp.evaluate(context);

        assertTrue("fn:concat should result in a String value",
                   result instanceof StringValue);

        assertEquals("fn:concat expression result should be expressions",
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.Value

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.