Package net.sf.saxon.value

Examples of net.sf.saxon.value.UntypedAtomicValue


        switch (getNodeKind()) {
            case Type.COMMENT:
            case Type.PROCESSING_INSTRUCTION:
                return new StringValue(getStringValueCS());
            default:
                return new UntypedAtomicValue(getStringValueCS());
        }
  }
View Full Code Here


    public Expression convertToStringJoin(StaticContext env) {
        if (select.getItemType(env.getConfiguration().getTypeHierarchy()).equals(BuiltInAtomicType.UNTYPED_ATOMIC)) {
            return select;
        } else if (select instanceof StringLiteral) {
            try {
                return new Literal(new UntypedAtomicValue(((StringLiteral)select).getValue().getStringValueCS()));
            } catch (XPathException err) {
                throw new AssertionError(err);
            }
        } else {
            StringFn fn = (StringFn) SystemFunction.makeSystemFunction("string", new Expression[]{select});
View Full Code Here

        switch (getNodeKind()) {
            case Type.COMMENT:
            case Type.PROCESSING_INSTRUCTION:
                return new StringValue(getStringValueCS());
            default:
                return new UntypedAtomicValue(getStringValueCS());
        }
    }
View Full Code Here

                if (depth[next] <= level) {
                    return UntypedAtomicValue.ZERO_LENGTH_UNTYPED;
                } else if (nodeKind[next] == Type.TEXT && depth[next+1] <= level) {
                    int length = beta[next];
                    int start = alpha[next];
                    return new UntypedAtomicValue(charBuffer.subSequence(start, start+length));
                } else if (nodeKind[next] == Type.WHITESPACE_TEXT && depth[next+1] <= level) {
                    return new UntypedAtomicValue(WhitespaceTextImpl.getStringValue(this, next));
                }

                // Now handle the general case

                FastStringBuffer sb = null;
                while (next < numberOfNodes && depth[next] > level) {
                    if (nodeKind[next]==Type.TEXT) {
                        if (sb==null) {
                            sb = new FastStringBuffer(1024);
                        }
                        sb.append(TinyTextImpl.getStringValue(this, next));
                    } else if (nodeKind[next]==Type.WHITESPACE_TEXT) {
                        if (sb==null) {
                            sb = new FastStringBuffer(1024);
                        }
                        WhitespaceTextImpl.appendStringValue(this, next, sb);
                    }
                    next++;
                }
                if (sb==null) {
                    return UntypedAtomicValue.ZERO_LENGTH_UNTYPED;
                } else {
                    return new UntypedAtomicValue(sb.condense());
                }

            case Type.TEXT:
                return new UntypedAtomicValue(TinyTextImpl.getStringValue(this, nodeNr));
            case Type.WHITESPACE_TEXT:
                return new UntypedAtomicValue(WhitespaceTextImpl.getStringValue(this, nodeNr));
            case Type.COMMENT:
            case Type.PROCESSING_INSTRUCTION:
                int start2 = alpha[nodeNr];
                int len2 = beta[nodeNr];
                if (len2==0) return UntypedAtomicValue.ZERO_LENGTH_UNTYPED;
View Full Code Here

     * @return an iterator returning a single untyped atomic value, equivalent to the string value of the node. This
     *         follows the standard rules for elements with mixed content.
     */

    public SequenceIterator getTypedValue(NodeInfo node) {
        return SingletonIterator.makeIterator(new UntypedAtomicValue(node.getStringValueCS()));
    }
View Full Code Here

     * @return the typed value.
     * @since 8.5
     */

    public Value atomize(NodeInfo node) {
        return new UntypedAtomicValue(node.getStringValue());
    }
View Full Code Here

            case Type.PROCESSING_INSTRUCTION:
                return SingletonIterator.makeIterator(new StringValue(stringValue));
            case Type.TEXT:
            case Type.DOCUMENT:
            case Type.NAMESPACE:
                return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue));
            default:
                if (typeAnnotation == -1 || typeAnnotation == StandardNames.XS_UNTYPED ||
                        typeAnnotation == StandardNames.XS_UNTYPED_ATOMIC) {
                    return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue));
                } else {
                    SchemaType stype = config.getSchemaType(typeAnnotation);
                    if (stype == null) {
                        String typeName = config.getNamePool().getDisplayName(typeAnnotation);
                        throw new IllegalStateException("Unknown type annotation " +
View Full Code Here

            case Type.PROCESSING_INSTRUCTION:
                return new StringValue(stringValue);
            case Type.TEXT:
            case Type.DOCUMENT:
            case Type.NAMESPACE:
                return new UntypedAtomicValue(stringValue);
            default:
                if (typeAnnotation == -1 || typeAnnotation == StandardNames.XS_UNTYPED ||
                        typeAnnotation == StandardNames.XS_UNTYPED_ATOMIC) {
                    return new UntypedAtomicValue(stringValue);
                } else {
                    SchemaType stype = config.getSchemaType(typeAnnotation);
                    if (stype == null) {
                        String typeName = config.getNamePool().getDisplayName(typeAnnotation);
                        throw new IllegalStateException("Unknown type annotation " +
View Full Code Here

     * If there is no type annotation, we return the string value, as an instance
     * of xs:untypedAtomic
     */

    public SequenceIterator getTypedValue() throws XPathException {
        return SingletonIterator.makeIterator(new UntypedAtomicValue(getStringValue()));
    }
View Full Code Here

     *         values.
     * @since 8.5
     */

    public Value atomize() throws XPathException {
        return new UntypedAtomicValue(getStringValue());
    }
View Full Code Here

TOP

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

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.