Package net.sf.saxon.type

Examples of net.sf.saxon.type.SchemaType


     * @param config The configuration. This is needed because the patterns that are
     * generated need access to schema information.
     */

    private void registerIdrefKey(Configuration config) {
        SchemaType idref = BuiltInSchemaFactory.getSchemaType(StandardNames.XS_IDREF);
        SchemaType idrefs = BuiltInSchemaFactory.getSchemaType(StandardNames.XS_IDREFS);
        Pattern idrefAtt = new NodeTestPattern(
                new ContentTypeTest(Type.ATTRIBUTE, idref, config));
        Pattern idrefsAtt = new NodeTestPattern(
                new ContentTypeTest(Type.ATTRIBUTE, idrefs, config));
        Pattern idrefElem = new NodeTestPattern(
View Full Code Here


            AtomicType type = (AtomicType)Type.getBuiltInItemType(uri, local);
            return type != null;
        }

        SchemaType st = config.getSchemaType(fingerprint);
        return (st != null && st instanceof AtomicType);
    }
View Full Code Here

        }

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

        if (arguments.length == 1) {
            SchemaType st = config.getSchemaType(nameCode & 0xfffff);
            if (st != null && st instanceof AtomicType) {
                return new CastExpression(arguments[0], (AtomicType)st, false);
            }
        }
View Full Code Here

                return "untyped";
            } else {
                return "untypedAtomic";
            }
        }
        SchemaType type = context.getController().getConfiguration().getSchemaType(code & 0xfffff);
        if (type==null) {
            // Anonymous types are not accessible by the namecode
            return context.getController().getNamePool().getDisplayName(code);
        }
        return "type " + type.getDescription();
    }
View Full Code Here

        ItemType in = operand.getItemType();
        if (Type.isSubType(in, Type.ANY_ATOMIC_TYPE)) {
            return in;
        }
        if (in instanceof ContentTypeTest) {
            SchemaType schemaType = ((ContentTypeTest)in).getSchemaType();
            if (schemaType instanceof AtomicType) {
                // TODO: could do better, e.g. with list types, mixed content elements, etc
                return (AtomicType)schemaType;
            }
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

      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

        }
        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

            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

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.