Package xbird.xquery.dm.value

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


        for(int i = 0; i < _items.size(); i++) {
            if(i != 0) {
                buf.append(' ');
            }
            Item it = _items.get(i);
            buf.append(it.stringValue());
        }
        return buf.toString(); // TODO cache
    }

    public boolean next(IFocus focus) throws XQueryException {
View Full Code Here


            Item delItem = delItor.next();
            final XQNode node;
            if(delItem instanceof XQNode) {
                node = (XQNode) delItem;
            } else { // TODO REVIEWME work around
                node = XQueryDataModel.createText(delItem.stringValue());
            }
            focus.setContextItem(node);
            return true;
        }
        focus.closeQuietly();
View Full Code Here

                    QNameValue err = (QNameValue) firstItem;
                    errorName = err.getValue();
                }
                Item secondItem = argv.getItem(1);
                assert (secondItem instanceof XString);
                desc = secondItem.stringValue();
            }
        }
        if(errObjects != null) {
            final StackTraceElement[] st = (new Throwable()).getStackTrace();
            errObjects = new String[st.length];
View Full Code Here

    public XString 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();
        Item thirdItem = argv.getItem(2);
        String replacement = thirdItem.stringValue();
        checkReplacement(replacement);
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();
        Item thirdItem = argv.getItem(2);
        String replacement = thirdItem.stringValue();
        checkReplacement(replacement);
        int flags = Pattern.UNIX_LINES;
        if(arglen == 4) {
View Full Code Here

        // 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();
        Item thirdItem = argv.getItem(2);
        String replacement = thirdItem.stringValue();
        checkReplacement(replacement);
        int flags = Pattern.UNIX_LINES;
        if(arglen == 4) {
            Item forthItem = argv.getItem(3);
            String flagsStr = forthItem.stringValue();
View Full Code Here

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

        final Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            // If the value of $sourceString is the empty sequence, the zero-length string is returned.
            return XString.valueOf("");
        }
        final String sourceString = firstItem.stringValue();
        final int maxSourceLen = sourceString.length();
        final Item secItem = argv.getItem(1);
        final XNumber secNum = (XNumber) secItem;
        // first character of a string is located at position 1, not position 0.
        final int startingLoc = Math.max(0, (int) Math.round(secNum.asDouble() - 1));
View Full Code Here

        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        final URI relative;
        String relativeStr = firstItem.stringValue();
        try {
            if(relativeStr.length() == 0) {
                relative = null;
            } else {
                relative = new URI(relativeStr);
View Full Code Here

        }
        final URI baseUri;
        final int arglen = argv.size();
        if(arglen == 2) {
            Item secondItem = argv.getItem(1);
            String baseStr = secondItem.stringValue();
            baseUri = URI.create(baseStr);
        } else {
            baseUri = dynEnv.getStaticContext().getBaseURI();
            if(baseUri == null) {
                throw new DynamicError("err:FONS0005", "BaseUri is not set in the static context.");
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.