Package net.sf.saxon.type

Examples of net.sf.saxon.type.SchemaType


            // this ensures that the Validate command produces multiple error messages
            schemaValidation |= Validation.VALIDATE_OUTPUT;
        }

        XMLReader parser = null;
        SchemaType topLevelType = null;
        if (source instanceof AugmentedSource) {
            stripSpace = ((AugmentedSource)source).getStripSpace();
        }
        if (stripSpace == Whitespace.UNSPECIFIED) {
            stripSpace = config.getStripsWhiteSpace();
View Full Code Here


                        uri = env.getDefaultElementNamespace();
                    } else {
                        uri = env.getURIForPrefix(prefix);
                    }
                    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 {
                        b = (type != null && env.isImportedSchema(uri));
                        // TODO: recognize extension types (in the java-type namespace)
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

        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

                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

        } 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

        addStartElement(newNameOfNode, inode.getSchemaType(), inscopeNS);
    }

    public void addStartElement(QName newName) {
        NodeName elemName = new FingerprintedQName(newName.getPrefix(), newName.getNamespaceURI(), newName.getLocalName());
        SchemaType typeCode = BuiltInType.getSchemaType(StandardNames.XS_UNTYPED);
        NamespaceBinding inscopeNS[] = null;
        addStartElement(elemName, typeCode, inscopeNS);
    }
View Full Code Here

        }
    }

    public Value convertSimpleTypeToSaxon(QName type, String value) {
        int fp = _config.getNamePool().allocate("", type.getNamespaceURI(), type.getLocalPart());
        SchemaType type2 = _config.getSchemaType(fp);
        if (type2 == null || !type2.isAtomicType()) {
            __log.warn("Can't find simple type " + type + " value " + value + " result: " + null);
            return null;
        } else {
            try {
                AtomicValue value2 = StringValue.convertStringToAtomicType(value, (AtomicType) type2, null).asAtomic();
View Full Code Here

        }
    }

    public static Value convertSimpleTypeToSaxon(QName type, String value, Configuration _config) {
        int fp = _config.getNamePool().allocate("", type.getNamespaceURI(), type.getLocalPart());
        SchemaType type2 = _config.getSchemaType(fp);
        if (type2 == null || !type2.isAtomicType()) {
            __log.warn("Can't find simple type " + type + " value " + value + " result: " + null);
            return null;
        } else {
            try {
                AtomicValue value2 = StringValue.convertStringToAtomicType(value, (AtomicType) type2, null).asAtomic();
View Full Code Here

TOP

Related Classes of net.sf.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.