Package org.pdf4j.saxon.type

Examples of org.pdf4j.saxon.type.SchemaType


                    }
                    if (ann2 == -1) {
                        // defensive programming
                        ann2 = StandardNames.XS_UNTYPED;
                    }
                    final SchemaType type1 = config.getSchemaType(ann1);
                    final SchemaType type2 = config.getSchemaType(ann2);
                    final boolean isSimple1 = type1.isSimpleType() || ((ComplexType)type1).isSimpleContent();
                    final boolean isSimple2 = type2.isSimpleType() || ((ComplexType)type2).isSimpleContent();
                    if (isSimple1 != isSimple2) {
                        explain(config, "one element has a simple type, the other does not", flags);
                        return false;
                    }
                    if (isSimple1 && isSimple2) {
View Full Code Here


        } else if (elementStrip == ALWAYS_STRIP) {
            preserve |= ALWAYS_STRIP;
        }
        if (preserve == 0 && typeCode != -1 && typeCode != StandardNames.XS_UNTYPED) {
            // if the element has simple content, whitespace stripping is disabled
            SchemaType type = getConfiguration().getSchemaType(typeCode);
            if (type.isSimpleType() || ((ComplexType)type).isSimpleContent()) {
                preserve |= CANNOT_STRIP;
            }
        }

        // put "preserve" value on top of stack
View Full Code Here

                nonIDs = new IntHashSet(20);
            }
            if (nonIDs.contains(typeCode)) {
                return false;
            }
            SchemaType type = getConfiguration().getSchemaType(typeCode);
            if (type.isAtomicType()) {
                if (getConfiguration().getTypeHierarchy().isSubType((AtomicType)type, BuiltInAtomicType.ID)) {
                    return true;
                } else {
                    nonIDs.add(typeCode);
                    return false;
View Full Code Here

        int fingerprint = config.getNamePool().getFingerprint(uri, local);
        if (fingerprint == -1) {
            return false;
        } else {
            SchemaType st = config.getSchemaType(fingerprint);
            return (st != null && st.isAtomicType());
        }
    }
View Full Code Here

        // Now see if it's a constructor function for a user-defined type

        if (arguments.length == 1) {
            int fp = config.getNamePool().getFingerprint(uri, localName);
            if (fp != -1) {
                SchemaType st = config.getSchemaType(fp);
                if (st != null && st.isAtomicType()) {
                    return new CastExpression(arguments[0], (AtomicType)st, true);
                }
            }
        }
View Full Code Here

        sameline = true;
        afterStartTag = true;
        afterEndTag = false;
        allWhite = true;
        line = 0;
        SchemaType type;
        if (suppressedElements != null && suppressedElements.contains(nameCode&NamePool.FP_MASK)) {
            suppressedAtLevel = level;
        }
        if (typeCode >= 1024 && suppressedAtLevel < 0 &&
                ((type = getConfiguration().getSchemaType(typeCode)) != null && type.isComplexType() &&
                        ((ComplexType)type).isMixedContent())) {
            // suppress indentation for elements with mixed content. (Note this also suppresses
            // indentation for all descendants of such elements. We could be smarter than this.)
            suppressedAtLevel = level;
        }
View Full Code Here

            return false;
        }
        if (!Whitespace.isWhite(node.getStringValue())) {
            return false;
        }
        SchemaType type = node.getConfiguration().getSchemaType(annotation);
        if (!type.isComplexType()) {
            return false;
        }
        if (((ComplexType)type).isMixedContent()) {
            return false;
        }
View Full Code Here

     */

    public boolean isDerivedFrom(String typeNamespaceArg,
                                 String typeNameArg,
                                 int derivationMethod) throws IllegalStateException {
        SchemaType base = schemaType.getBaseType();
        int fingerprint = config.getNamePool().allocate("", typeNamespaceArg, typeNameArg);
        if (derivationMethod==0 || (derivationMethod & schemaType.getDerivationMethod()) != 0) {
            if (base.getFingerprint() == fingerprint) {
                return true;
            } else if (base instanceof AnyType) {
                return false;
            } else {
                return new TypeInfoImpl(config, base).isDerivedFrom(typeNamespaceArg, typeNameArg, derivationMethod);
View Full Code Here

        }
        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 {
                    typeName = getNamePool().getDisplayName(annotation);
                } catch (Exception err) {
                    typeName = annotation + "";
                }
                throw new XPathException("Unknown type annotation " +
                        Err.wrap(typeName) + " in document instance");
            } else {
                return stype.getTypedValue(this);
            }
        }
    }
View Full Code Here

            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 " +
                        Err.wrap(typeName) + " in document instance");
            } else {
                return stype.atomize(this);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.type.SchemaType

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.