Package net.sf.saxon.value

Examples of net.sf.saxon.value.StringValue


            } else {
                if (kids.next() == null) {
                    // there is exactly one child node
                    if (first.getNodeKind() == Type.TEXT) {
                        // it is a text node: optimize for this case
                        select = new StringValue(first.getStringValue());
                    //} else if (first instanceof XSLValueOf) {
                    //    // it is an xsl:value-of instruction: optimize this case
                    //    // *** optimization removed: it doesn't handle value-of with separator, type conversion,
                          // etc.
                    //    XSLValueOf v = (XSLValueOf)first;
View Full Code Here


    }

    public Expression compile(Executable exec) throws TransformerConfigurationException {
        Comment inst = new Comment();
        compileContent(exec, inst);
        inst.setSeparator(new StringValue(select==null ? "" : " "));
        ExpressionTool.makeParentReferences(inst);
        return inst;
    }
View Full Code Here

    }

    public Item evaluateItem(XPathContext context) throws XPathException {
        AtomicValue av = (AtomicValue)input.evaluateItem(context);
        if (av==null) return null;
        StringValue sv = (StringValue)av.getPrimitiveValue();

        try {
            String parts[] = Name.getQNameParts(sv.getStringValue());
            String uri = nsContext.getURIForPrefix(parts[0], true);
            if (uri==null) {
                DynamicError e = new DynamicError("Prefix '" + parts[0] + "' has not been declared");
                e.setXPathContext(context);
                throw e;
View Full Code Here

    */

    public Item evaluateItem(XPathContext c) throws XPathException {
        AtomicValue sv = (AtomicValue)argument[0].evaluateItem(c);
        if (sv==null) return StringValue.EMPTY_STRING;
        return new StringValue(normalize(sv.getStringValue()));
    }
View Full Code Here

        String first = it.getStringValue();

        it = iter.next();
        if (it==null) {
            return new StringValue(first);
        }

        StringBuffer sb = new StringBuffer();
        sb.append(first);

        // Type checking ensures that the separator is not an empty sequence
        String sep = argument[1].evaluateItem(c).getStringValue();
        sb.append(sep);
        sb.append(it.getStringValue());

        while (true) {
            it = iter.next();
            if (it == null) {
                return new StringValue(sb);
            }
            sb.append(sep);
            sb.append(it.getStringValue());
        }
    }
View Full Code Here

        AtomicValue sv = (AtomicValue)argument[0].evaluateItem(c);
        if (sv==null) return null;

        switch(operation) {
            case UPPERCASE:
                return new StringValue(sv.getStringValue().toUpperCase());
            case LOWERCASE:
                return new StringValue(sv.getStringValue().toLowerCase());
            default:
                throw new UnsupportedOperationException("Unknown function");
        }
    }
View Full Code Here

            } catch (XPathException err) {
                throw new ValidationException(err.getMessage());
            }
        } else {
            try {
                new StringValue(value).convert(this, null);
            } catch (XPathException err) {
                throw new ValidationException(err.getMessage());
            }
        }
    }
View Full Code Here

            } catch (XPathException err) {
                throw new ValidationException("Malformed QName in content: " + Err.wrap(value));
            }
        }
        try {
            return SingletonIterator.makeIterator(new StringValue(value).convert(this, null));
        } catch (XPathException err) {
            throw new ValidationException(err.getMessage());
        }
    }
View Full Code Here

        SequenceIterator iter = operand.iterate(context);
        Item it = iter.next();
        if (it == null) {
            return StringValue.EMPTY_STRING;
        } else {
            return new StringValue(it.getStringValue());
        }
    }
View Full Code Here

        KeyManager keyManager = k.context.getController().getKeyManager();
        AtomicValue keyValue;
        if (item instanceof AtomicValue) {
            keyValue = (AtomicValue)item;
        } else {
            keyValue = new StringValue(item.getStringValue());
        }
        return keyManager.selectByKey(
                StandardNames.XS_IDREFS, k.document, keyValue, k.context);

    }
View Full Code Here

TOP

Related Classes of net.sf.saxon.value.StringValue

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.