Package xbird.xquery.dm.value

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


    public Sequence eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv) throws XQueryException {
        if(argv == null || argv.size() != 2) {
            throw new IllegalStateException();
        }
        Item arg1 = argv.getItem(0);
        String docPath = arg1.stringValue();
        Item arg2 = argv.getItem(1);
        String colPath = arg2.stringValue();
        File docFile = new File(docPath);
        if(!docFile.exists()) {
            return ValueSequence.EMPTY_SEQUENCE;
View Full Code Here


            throw new IllegalStateException();
        }
        Item arg1 = argv.getItem(0);
        String docPath = arg1.stringValue();
        Item arg2 = argv.getItem(1);
        String colPath = arg2.stringValue();
        File docFile = new File(docPath);
        if(!docFile.exists()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        DbCollection col = DbCollection.getCollection(colPath);
View Full Code Here

        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return XString.valueOf("");
        }
        assert (firstItem instanceof XString);
        String uripart = firstItem.stringValue();
        String escaped = XMLUtils.escapeUri(uripart, true);
        return XString.valueOf(escaped);
    }

}
View Full Code Here

            throw new DynamicError("Invalid XQueryD expression. Endpoint does not found");
        }
        final List<String> endpoints = new ArrayList<String>(4);
        do {
            Item firstItem = epFocus.next();
            String endpointStr = firstItem.stringValue();
            endpoints.add(endpointStr);
        } while(epFocus.hasNext());
        epFocus.closeQuietly();
        return endpoints;
    }
View Full Code Here

            throws XQueryException {
        Item docuri = argv.getItem(0);
        if(docuri.isEmpty()) {
            return XQueryDataModel.createDocument();
        } else {
            final String docName = docuri.stringValue();
            URI baseuri = dynEnv.getStaticContext().getBaseURI();
            if(baseuri == null) { // TODO REVIEWME workaround
                baseuri = dynEnv.getStaticContext().getSystemBaseURI();
            }
            final URI resolvedUri = baseuri.resolve(docName);
View Full Code Here

        // If $uri-part is the empty sequence, returns the zero-length string.
        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return XString.valueOf("");
        }
        String uripart = firstItem.stringValue();
        String escaped = XMLUtils.escapeUri(uripart, false);
        return XString.valueOf(escaped);
    }

}
View Full Code Here

            throws XQueryException {
        Item uriItem = argv.getItem(0);
        if(uriItem.isEmpty()) {
            return BooleanValue.FALSE;
        }
        String uriStr = uriItem.stringValue();
        // If $uri is not a valid xs:anyURI, an error is raised [err:FODC0005].
        final URI docuri;
        try {
            final String unescaped = XMLUtils.unescapeXML(uriStr);
            docuri = new URI(unescaped);
View Full Code Here

            return "";
        }
        final StringBuilder buf = new StringBuilder(255);
        while(true) {
            final Item it = itor.next();
            buf.append(it.stringValue());
            if(itor.hasNext()) {
                buf.append(' ');
            } else {
                break;
            }
View Full Code Here

            throws XQueryException {
        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return XString.valueOf("");
        }
        String arg = firstItem.stringValue();
        final String converted = arg.toUpperCase();
        return XString.valueOf(converted);
    }

}
View Full Code Here

            throws XQueryException {
        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return XString.valueOf("");
        }
        String arg = firstItem.stringValue();
        String converted = arg.toLowerCase();
        return XString.valueOf(converted);
    }

}
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.