Package xbird.xquery.dm.value

Examples of xbird.xquery.dm.value.Item.stringValue()


        Item secondItem = argv.getItem(1);
        if(secondItem.isEmpty()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        String comparand1 = firstItem.stringValue();
        String comparand2 = secondItem.stringValue();
        final int cmp;
        final int arglen = argv.size();
        assert (arglen == 2 || arglen == 3);
        if(arglen == 3) {
            Item thirdItem = argv.getItem(2);
View Full Code Here


        final int cmp;
        final int arglen = argv.size();
        assert (arglen == 2 || arglen == 3);
        if(arglen == 3) {
            Item thirdItem = argv.getItem(2);
            String collation = thirdItem.stringValue();
            Collator collator = CollationUtils.resolve(collation, dynEnv.getStaticContext());
            cmp = collator.compare(comparand1, comparand2);
        } else {
            cmp = comparand1.compareTo(comparand2);
        }
View Full Code Here

        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        assert (firstItem instanceof XString);
        String viewloc = firstItem.stringValue();
        Reader reader = readQuery(viewloc, dynEnv.getStaticContext());
        Sequence res = Eval.evaluateQuery(reader, dynEnv);
        return res;
    }
View Full Code Here

    }

    public Sequence eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv)
            throws XQueryException {
        Item firstItem = argv.getItem(0);
        String str = firstItem.stringValue();
        int hashvalue = str.hashCode();
        return new XInteger(hashvalue);
    }

}
View Full Code Here

    public BooleanValue eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv)
            throws XQueryException {
        final int arglen = argv.size();
        Item firstItem = argv.getItem(0);
        // If $input is the empty sequence, it is interpreted as the zero-length string.
        String input = firstItem.isEmpty() ? "" : firstItem.stringValue();
        Item secondItem = argv.getItem(1);
        String pattern = secondItem.stringValue();
        int flags = Pattern.UNIX_LINES;
        if(arglen == 3) {
            Item thirdItem = argv.getItem(2);
View Full Code Here

        final int arglen = argv.size();
        Item firstItem = argv.getItem(0);
        // If $input is the empty sequence, it is interpreted as the zero-length string.
        String input = firstItem.isEmpty() ? "" : firstItem.stringValue();
        Item secondItem = argv.getItem(1);
        String pattern = secondItem.stringValue();
        int flags = Pattern.UNIX_LINES;
        if(arglen == 3) {
            Item thirdItem = argv.getItem(2);
            String flagsStr = thirdItem.stringValue();
            flags = convertFlags(flagsStr);
View Full Code Here

        Item secondItem = argv.getItem(1);
        String pattern = secondItem.stringValue();
        int flags = Pattern.UNIX_LINES;
        if(arglen == 3) {
            Item thirdItem = argv.getItem(2);
            String flagsStr = thirdItem.stringValue();
            flags = convertFlags(flagsStr);
        }
        final Pattern compiled;
        try {
            compiled = Pattern.compile(pattern, flags);
View Full Code Here

            // If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002]
            Item contextItem = dynEnv.contextItem();
            if(contextItem == null) {
                throw new DynamicError("err:XPDY0002", "ContextItem is not set");
            }
            arg = contextItem.stringValue();
        } else {
            // If the value of $arg is the empty sequence, returns the zero-length string.
            Item first = argv.getItem(0);
            arg = first.stringValue();
        }
View Full Code Here

            }
            arg = contextItem.stringValue();
        } else {
            // If the value of $arg is the empty sequence, returns the zero-length string.
            Item first = argv.getItem(0);
            arg = first.stringValue();
        }
        String normed = XMLUtils.normalizeString(arg);
        return XString.valueOf(normed);
    }
View Full Code Here

        if(arg.isEmpty()) {
            // If the value of $arg1 is the empty sequence, the zero-length string is returned.
            return XString.valueOf("");
        }
        final Item sep = argv.getItem(1);
        final String separator = sep.stringValue();
        final StringBuilder buf = new StringBuilder(256);
        boolean first = true;
        for(Item it : arg) {
            if(first) {
                first = false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.