Package net.sf.saxon.value

Examples of net.sf.saxon.value.Value


        if (parameters == null) {
            parameters = new ParameterSet();
        }

        Value result;
        try {
            result = Value.convertJavaObjectToXPath(value, this);
            if (result==null) {
                result = EmptySequence.getInstance();
            }
View Full Code Here


    * @throws XPathException if the variable is undefined
    */

    public SequenceIterator iterate(XPathContext c) throws XPathException {
        // System.err.println("Evaluate variable " + binding.getVariableName() + ", context = " + c);
        Value val = evaluateVariable(c);
        return val.iterate(c);

    }
View Full Code Here

        return val.iterate(c);

    }

    public Item evaluateItem(XPathContext c) throws XPathException {
        Value actual = evaluateVariable(c);
        return Value.asItem(actual, c);
    }
View Full Code Here

    */

    public SequenceIterator iterate(XPathContext context) throws XPathException {
        if (context.getController().isTracing()) {
            String label = argument[1].evaluateAsString(context);
            Value value = ExpressionTool.eagerEvaluate(argument[0], context);
            notifyListener(label, value, context);
            return value.iterate(context);
        } else {
            return new TracingIterator(argument[0].iterate(context), argument[1].evaluateAsString(context));
        }
    }
View Full Code Here

    * only when the cardinality is zero or one. If the function is tail recursive,
    * it returns an Object representing the arguments to the next (recursive) call
    */

    public Item evaluateItem(XPathContext c) throws XPathException {
        Value val = callFunction(c);
        if (val instanceof Item) {
            return (Item)val;
        } else {
            return val.iterate(c).next();
        }
    }
View Full Code Here

            c2.setOrigin(UserFunctionCall.this);
            return function.call(actualArgs, c2, false);
        }

        public Value appendTo(SequenceReceiver out) throws XPathException {
            Value v = call();
            SequenceIterator fv = v.iterate(evaluationContext);
            while (true) {
                Item fvit = fv.next();
                if (fvit == null) return null;
                if (fvit instanceof UserFunctionCall.FunctionCallPackage) {
                    return (Value)fvit;
View Full Code Here

    public SequenceIterator iterate(XPathContext c) throws XPathException {
        return c.evaluateLocalVariable(slotNumber).iterate(c);
    }

    public Item evaluateItem(XPathContext c) throws XPathException {
        Value actual = c.evaluateLocalVariable(slotNumber);
        return Value.asItem(actual, c);
    }
View Full Code Here

    public int getWeight() {
        return 10000;
    }

    public Value transform(Object source, TransformationContext context) {
        Value result = null;
        if (source instanceof Integer) {
            result = new IntegerValue((Integer)source);
        } else if (source instanceof Long) {
            result = new IntegerValue((Long)source);
        } else if (source instanceof Short) {
View Full Code Here

      */

     public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException {
         // if the expression is a constant value, check that it is valid for the type
         if (select instanceof Literal) {
             Value selectValue = ((Literal)select).getValue();
             SimpleType stype = null;
             if (parentType instanceof SimpleType && whole) {
                 stype = (SimpleType)parentType;
             } else if (parentType instanceof ComplexType && ((ComplexType)parentType).isSimpleContent()) {
                 stype = ((ComplexType)parentType).getSimpleContentType();
             }
             if (whole && stype != null && !stype.isNamespaceSensitive()) {
                        // Can't validate namespace-sensitive content statically
                 ValidationFailure err = stype.validateContent(
                         selectValue.getStringValue(), null, env.getConfiguration().getNameChecker());
                 if (err != null) {
                     err.setLocator(this);
                     throw err.makeException();
                 }
                 return;
             }
             if (parentType instanceof ComplexType &&
                     !((ComplexType)parentType).isSimpleContent() &&
                     !((ComplexType)parentType).isMixedContent() &&
                     !Whitespace.isWhite(selectValue.getStringValue())) {
                 XPathException err = new XPathException("Complex type " + parentType.getDescription() +
                         " does not allow text content " +
                         Err.wrap(selectValue.getStringValue()));
                 err.setLocator(this);
                 err.setIsTypeError(true);
                 throw err;
             }
         }
View Full Code Here

  public int getWeight() {
    return 10000;
  }

  public Value transform(Object source, TransformationContext context) {
    Value result = null;
    if(source instanceof Integer) {
      result = IntegerValue.makeIntegerValue(BigInteger.valueOf(((Integer)source)));
    } else if(source instanceof Long) {
      result = IntegerValue.makeIntegerValue(BigInteger.valueOf(((Long)source)));
    } else if(source instanceof Short) {
View Full Code Here

TOP

Related Classes of net.sf.saxon.value.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.