Package net.sf.saxon.type

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


                    }
                    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

        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

     */

    public ItemType getAtomicType(QName name) throws SaxonApiException {
        Configuration config = processor.getUnderlyingConfiguration();
        int fp = config.getNamePool().allocate("", name.getNamespaceURI(), name.getLocalName());
        SchemaType type = config.getSchemaType(fp);
        if (type == null || !type.isAtomicType()) {
            throw new SaxonApiException("Unknown atomic type " + name.getClarkName());
        }
        return new ItemType((AtomicType)type, processor);
//        String uri = name.getNamespaceURI();
//        if (!NamespaceConstant.SCHEMA.equals(uri)) {
View Full Code Here

            int elementFP = config.getNamePool().allocate("", name.getNamespaceURI(), name.getLocalName());
            nameTest = new NameTest(Type.ELEMENT, elementFP, config.getNamePool());
        }
        if (schemaType != null) {
            int typeFP = config.getNamePool().allocate("", schemaType.getNamespaceURI(), schemaType.getLocalName());
            SchemaType type = config.getSchemaType(typeFP);
            if (type == null) {
                throw new SaxonApiException("Unknown schema type " + schemaType.getClarkName());
            }
            contentTest = new ContentTypeTest(Type.ELEMENT, type, config);
            contentTest.setNillable(nillable);
View Full Code Here

            int attributeFP = config.getNamePool().allocate("", name.getNamespaceURI(), name.getLocalName());
            nameTest = new NameTest(Type.ATTRIBUTE, attributeFP, config.getNamePool());
        }
        if (schemaType != null) {
            int typeFP = config.getNamePool().allocate("", schemaType.getNamespaceURI(), schemaType.getLocalName());
            SchemaType type = config.getSchemaType(typeFP);
            if (type == null) {
                throw new SaxonApiException("Unknown schema type " + schemaType.getClarkName());
            }
            contentTest = new ContentTypeTest(Type.ATTRIBUTE, type, config);
        }
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)).isComplexType() &&
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

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