Package xbird.xquery.dm.value.literal

Examples of xbird.xquery.dm.value.literal.XString


    }

    @Override
    public AtomicValue typedValue() {
        if(QNameUtil.isSame(_name, XMLConstants.XML_NS_URI, "id")) {
            return new XString(stringValue(), IDType.ID);
        }
        return super.typedValue();
    }
View Full Code Here


        }

        protected XString match(String src, String pattern, RuleBasedCollator collator) {
            final int index = CollationUtils.indexOf(src, pattern, collator);
            if(index == -1) {
                return new XString("");
            } else {
                final String res = src.substring(index + pattern.length());
                return new XString(res);
            }
        }
View Full Code Here

                            persistKeys[0] = fpv;
                        } else {
                            if(counter == 0) {
                                _keyTypes.set(0, StringType.STRING);
                            }
                            persistKeys[0] = new XString(fpv.stringValue());
                        }
                        joinTable.put(persistKeys, it);
                    }
                    pkvItor.closeQuietly();
                } else {// TODO FIXME multiple join keys   
                    for(int i = 0; i < keysize; i++) {
                        final XQExpression key = _pkeyExprs.get(i);
                        final Sequence<? extends Item> pkv = key.eval(it, dynEnv);
                        final Iterator<? extends Item> pkvItor = pkv.iterator();
                        if(!pkvItor.hasNext()) {
                            continue outer;
                        }
                        final Item fpv = pkvItor.next();
                        if(pkvItor.hasNext()) {
                            persistKeys[i] = new SingleCollection(pkv, dynEnv);
                        } else if(_isNodeComp || fpv instanceof AtomicValue) {
                            persistKeys[i] = fpv;
                        } else {
                            if(counter == 0) {
                                _keyTypes.set(i, StringType.STRING);
                            }
                            persistKeys[i] = new XString(fpv.stringValue());
                        }
                    }
                    joinTable.put(persistKeys, it);
                }
                counter++;
View Full Code Here

            if(_isNodeComp) {
                return item;
            }
            final Type t = _keyTypes.get(index);
            if(t == StringType.STRING) {
                return new XString(item.stringValue());
            }
            final AtomicValue it = (item instanceof AtomicValue) ? (AtomicValue) item
                    : new XString(item.stringValue());
            if(t instanceof AtomicType) {
                final AtomicType trgType = (AtomicType) t;
                final AtomicValue converted = it.castAs(trgType, dynEnv);
                return converted;
            }
View Full Code Here

        switch(tid) {
            case TypeTable.UNTYPED_ATOMIC_TID:
                atomv = new UntypedAtomicValue(stringValue());
                break;
            case TypeTable.STRING_TID:
                atomv = new XString(stringValue());
                break;
            case TypeTable.DURATION_TID:
                atomv = this;
                break;
            case TypeTable.YEAR_MONTH_DURATION_TID:
View Full Code Here

                    if(fromUri) {
                        File testDataFile = new File(xqtsDir, testFileRelDir);
                        String dest = testDataFile.toURI().toString();
                        QualifiedName varName = QNameTable.instantiate(XMLConstants.DEFAULT_NS_PREFIX, varNameStr);
                        Variable var = new Variable.GlobalVariable(varName, null);
                        var.setResult(new XString(dest));
                        xqmod.putVariable(varName, var);
                    } else {
                        DTMDocument testDataDoc = _docCache.get(testDataId);
                        if(testDataDoc == null) {
                            File testDataFile = new File(xqtsDir, testFileRelDir);
View Full Code Here

    }

    public Sequence eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv)
            throws XQueryException {
        String hostname = NetUtils.getLocalHostName();
        return new XString(hostname);
    }
View Full Code Here

        return isCData;
    }

    public void appendText(String data) {
        String s = ((XString) value).getValue();
        this.value = new XString(s.concat(data));
    }
View Full Code Here

        // If $qname is the empty sequence, returns the empty sequence.
        Item firstItem = argv.getItem(0);
        if(firstItem.isEmpty()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        XString qname = (XString) firstItem;
        String qnameStr = qname.getValue();
        final int pos = qnameStr.indexOf(':');
        final String nsuri;
        if(pos == -1) {
            // If the $qname has no prefix, and there is no namespace binding for $element
            // corresponding to the default (unnamed) namespace, then the resulting expanded-QName
View Full Code Here

                    if(fromUri) {
                        File testDataFile = new File(xqtsDir, testFileRelDir);
                        String dest = testDataFile.toURI().toString();
                        QualifiedName varName = QNameTable.instantiate(XMLConstants.DEFAULT_NS_PREFIX, varNameStr);
                        Variable var = new Variable.GlobalVariable(varName, null);
                        var.setResult(new XString(dest));
                        xqmod.putVariable(varName, var);
                    } else {
                        DTMDocument testDataDoc = _docCache.get(testDataId);
                        if(testDataDoc == null) {
                            File testDataFile = new File(xqtsDir, testFileRelDir);
View Full Code Here

TOP

Related Classes of xbird.xquery.dm.value.literal.XString

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.