Package org.pdf4j.saxon.value

Examples of org.pdf4j.saxon.value.UntypedAtomicValue


    public SequenceIterator getTypedValue() throws XPathException {
        switch (getNodeKind()) {
            case Type.ELEMENT:
            case Type.ATTRIBUTE:
                return SingletonIterator.makeIterator(new UntypedAtomicValue(getStringValueCS()));
            default:
                return super.getTypedValue();
        }
    }
View Full Code Here


        } catch (ArrayIndexOutOfBoundsException err) {
            throw new NullPointerException();
        }
        switch (kind) {
            case Type.TEXT: {
                return new UntypedAtomicValue(TinyTextImpl.getStringValue(tree, nextNodeNr));
            }
            case Type.WHITESPACE_TEXT: {
                return new UntypedAtomicValue(WhitespaceTextImpl.getStringValue(tree, nextNodeNr));
            }
            case Type.ELEMENT: {
                int type = tree.getTypeAnnotation(nextNodeNr);
                switch (type) {
                    case StandardNames.XS_UNTYPED:
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

            } else if (argname.startsWith("+")) {
                // parameters starting with "+" are taken as input documents
                Object sources = Transform.loadDocuments(argvalue, useURLs, config, true);
                dynamicEnv.setParameter(argname.substring(1), sources);
            } else {
                dynamicEnv.setParameter(argname, new UntypedAtomicValue(argvalue));
            }
        }

        if (additionalSchemas != null) {
            loadAdditionalSchemas(config, additionalSchemas);
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

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

        if ((annotation & NodeInfo.IS_DTD_TYPE) != 0) {
            annotation = StandardNames.XS_UNTYPED_ATOMIC;
        }
        annotation &= NamePool.FP_MASK;
        if (annotation == -1 || annotation == StandardNames.XS_UNTYPED_ATOMIC || annotation == StandardNames.XS_UNTYPED) {
            return SingletonIterator.makeIterator(new UntypedAtomicValue(getStringValueCS()));
        } else {
            SchemaType stype = getConfiguration().getSchemaType(annotation);
            if (stype == null) {
                String typeName;
                try {
View Full Code Here

        int annotation = getTypeAnnotation();
        if ((annotation & NodeInfo.IS_DTD_TYPE) != 0) {
            annotation = StandardNames.XS_UNTYPED_ATOMIC;
        }
        if (annotation == -1 || annotation == StandardNames.XS_UNTYPED_ATOMIC || annotation == StandardNames.XS_UNTYPED) {
            return new UntypedAtomicValue(getStringValueCS());
        } else {
            SchemaType stype = getConfiguration().getSchemaType(annotation);
            if (stype == null) {
                String typeName = getNamePool().getDisplayName(annotation);
                throw new XPathException("Unknown type annotation " +
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

TOP

Related Classes of org.pdf4j.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.