Package org.pdf4j.saxon.type

Examples of org.pdf4j.saxon.type.SchemaType


                        return tree.getAtomizedValueOfUntypedNode(nextNodeNr);
                    case StandardNames.XS_STRING:
                        return new StringValue(TinyParentNodeImpl.getStringValue(tree, nextNodeNr));
                    default:
                        Configuration config = tree.getConfiguration();
                        SchemaType stype = config.getSchemaType(type);
                        if (stype instanceof AtomicType && !((AtomicType)stype).isNamespaceSensitive()) {
                            CharSequence value = TinyParentNodeImpl.getStringValue(tree, nextNodeNr);
                            return StringValue.convertStringToAtomicType(
                                    value, (AtomicType)stype, config.getNameChecker()
                            ).asAtomic();
View Full Code Here


                        } catch (XPathException err) {
                            b = false;
                        }
                    } else {
                        int fingerprint = config.getNamePool().allocate(prefix, uri, parts[1]) & 0xfffff;
                        SchemaType type = config.getSchemaType(fingerprint);
                        if (type instanceof BuiltInAtomicType) {
                            b = env.isAllowedBuiltInType((BuiltInAtomicType)type);
                        } else if (type instanceof BuiltInListType) {
                            b = config.isSchemaAware(Configuration.XSLT);
                        } else {
View Full Code Here

            case TYPE_AVAILABLE:
                String uri = qName.getNamespaceURI();
                if (uri.equals(NamespaceConstant.SCHEMA) || importedSchemaNamespaces.contains(uri)) {
                    final int fp = context.getNamePool().allocate(
                            qName.getPrefix(), uri, qName.getLocalName()) & 0xfffff;
                    SchemaType type = context.getConfiguration().getSchemaType(fp);
                    b = (type != null);
                } else {
                    return BooleanValue.FALSE;
                }
View Full Code Here

      receiver.endElement();
    }
    }

    private void checkNotNamespaceSensitive(Configuration config, final int typeCode) throws XPathException {
        SchemaType type = config.getSchemaType(typeCode & NamePool.FP_MASK);
        if (type instanceof SimpleType && ((SimpleType)type).isNamespaceSensitive()) {
            throw new CopyNamespaceSensitiveException(
                    "Cannot copy QName or NOTATION values without copying namespaces");
//            err.setErrorCode((language == Configuration.XSLT ? "XTTE0950" : "XQTY0086"));
//            throw err;
View Full Code Here

//        int topLevelNameCode = -1;
//        int dtdValidation = config.isValidation() ? Validation.STRICT : Validation.STRIP;


        XMLReader parser = null;
        SchemaType topLevelType = null;

        if (source instanceof AugmentedSource) {
            AugmentedSource as = (AugmentedSource)source;
            options.setPleaseCloseAfterUse(as.isPleaseCloseAfterUse());
            stripSpace = as.getStripSpace();
View Full Code Here

        Configuration config = pipe.getConfiguration();
        int schemaValidation = options.getSchemaValidationMode();
        if ((schemaValidation & Validation.VALIDATION_MODE_MASK) != Validation.PRESERVE) {
            // Add a document validator to the pipeline
            int stripSpace = options.getStripSpace();
            SchemaType topLevelType = options.getTopLevelType();
            StructuredQName topLevelElement = options.getTopLevelElement();
            int topLevelElementCode = -1;
            if (topLevelElement != null) {
                topLevelElementCode = config.getNamePool().allocate(
                        topLevelElement.getPrefix(), topLevelElement.getNamespaceURI(), topLevelElement.getLocalName());
View Full Code Here

        if (typeAtt!=null) {
            if (!getConfiguration().isSchemaAware(Configuration.XSLT)) {
                compileError(
                        "The @type attribute is available only with a schema-aware XSLT processor", "XTSE1660");
            } else {
                SchemaType type = getSchemaType(typeAtt);
                if (type == null) {
                    compileError("Unknown attribute type " + typeAtt, "XTSE1520");
                } else {
                    if (type.isSimpleType()) {
                        schemaType = (SimpleType)type;
                    } else {
                        compileError("Type annotation for attributes must be a simple type", "XTSE1530");
                        type = null;
                    }
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

            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 " +
                                Err.wrap(typeName) + " in standalone node");
                    } else {
                        return stype.getTypedValue(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.