Package xbird.xquery.dm.value

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


            // 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");
            }
            String sv = contextItem.stringValue();
            // If the value of $arg is the empty sequence, the xs:integer 0 is returned.
            return XInteger.valueOf(sv.length());
        }
        Item first = argv.getItem(0);
        final String argstr = first.stringValue();
View Full Code Here


            String sv = contextItem.stringValue();
            // If the value of $arg is the empty sequence, the xs:integer 0 is returned.
            return XInteger.valueOf(sv.length());
        }
        Item first = argv.getItem(0);
        final String argstr = first.stringValue();
        return XInteger.valueOf(argstr.length());
    }

}
View Full Code Here

        Item firstItem = argv.getItem(0);
        // If the value of $arg is the empty sequence, returns the zero-length string.
        if(firstItem.isEmpty()) {
            return XString.valueOf("");
        }
        String arg = firstItem.stringValue();
        // If the $normalizationForm is absent, as in the first format above,
        // it shall be assumed to be "NFC"
        String nform = "NFC";
        if(arglen == 2) {
            Item secondItem = argv.getItem(1);
View Full Code Here

        // If the $normalizationForm is absent, as in the first format above,
        // it shall be assumed to be "NFC"
        String nform = "NFC";
        if(arglen == 2) {
            Item secondItem = argv.getItem(1);
            nform = secondItem.stringValue();
        }
        final String normed;
        if("NFC".equalsIgnoreCase(nform)) {
            normed = Normalizer.normalize(arg, Normalizer.NFC);
        } else if("NFD".equalsIgnoreCase(nform)) {
View Full Code Here

        }
        Item secItem = argv.getItem(1);
        Item thirdItem = argv.getItem(2);
        String src = firstItem.stringValue();
        String map = secItem.stringValue();
        String trans = thirdItem.stringValue();
        String translated = translate(src, map, trans);
        return XString.valueOf(translated);
    }

    private static String translate(String src, String map, String trans) {
View Full Code Here

        Item secondItem = argv.getItem(1);
        if(secondItem.isEmpty()) {
            return ValueSequence.EMPTY_SEQUENCE;
        }
        String comparand1 = firstItem.stringValue();
        String comparand2 = secondItem.stringValue();
        final boolean b = comparand1.equals(comparand2);
        return b ? BooleanValue.TRUE : BooleanValue.FALSE;
    }

}
View Full Code Here

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

}
View Full Code Here

                            final Sequence<? extends Item> atomized = keyval.atomize(dynEnv);
                            final Item keyitem = SingleCollection.wrap(atomized, dynEnv);
                            if(keyitem instanceof AtomicValue) {
                                tuple[i + 1] = keyitem;
                            } else {//TODO typed value
                                tuple[i + 1] = keyitem.stringValue();
                            }
                        }
                    }
                    items.add(tuple);
                }
View Full Code Here

        }
        final StringBuilder buf = new StringBuilder(256);
        final int arglen = argv.size();
        for(int i = 0; i < arglen; i++) {
            Item arg = argv.getItem(i);
            String argStr = arg.stringValue();
            if(argStr.length() > 0) {
                buf.append(argStr);
            }
        }
        final String ret = buf.toString();
View Full Code Here

                            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

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.