/** * Set the schema type to be used for validation * @param type the type to be used for validation. (For a document constructor, this is the required * type of the document element) */ public void setSchemaType(SchemaType type) { schemaType = type; namespaceSensitiveType = (type instanceof SimpleType) && ((SimpleType)type).isNamespaceSensitive(); }
/** * Set the schema type to be used for validation * @param type the type to be used for validation. (For a document constructor, this is the required * type of the document element) */ public void setSchemaType(SchemaType type) { schemaType = type; namespaceSensitiveType = (type instanceof SimpleType) && ((SimpleType)type).isNamespaceSensitive(); }
public StringToUnionConverter(PlainType targetType, ConversionRules rules) { if (!targetType.isPlainType()) { throw new IllegalArgumentException(); } if (((SimpleType) targetType).isNamespaceSensitive()) { throw new IllegalArgumentException(); } this.targetType = (SimpleType) targetType; this.rules = rules; }
public StringToUnionConverter(PlainType targetType, ConversionRules rules) { if (!targetType.isPlainType()) { throw new IllegalArgumentException(); } if (((SimpleType) targetType).isNamespaceSensitive()) { throw new IllegalArgumentException(); } this.targetType = (SimpleType) targetType; this.rules = rules; }
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; } }
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; } }
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; } }
private boolean mayInvolveCastToQName(TypeHierarchy th, Expression e1, Expression e2) { SimpleType s1 = (SimpleType) e1.getItemType().getAtomizedItemType(); return (s1 == BuiltInAtomicType.ANY_ATOMIC || s1.isNamespaceSensitive()) && th.relationship(e2.getItemType().getAtomizedItemType(), BuiltInAtomicType.UNTYPED_ATOMIC) != TypeHierarchy.DISJOINT && (e2.getSpecialProperties() & StaticProperty.NOT_UNTYPED_ATOMIC) == 0; }
public void validate() throws XPathException { if (schemaType != null) { if (schemaType.isNamespaceSensitive()) { compileError("Validation at attribute level must not specify a " + "namespace-sensitive type (xs:QName or xs:NOTATION)", "XTTE1545"); } } attributeName = typeCheck("name", attributeName); namespace = typeCheck("namespace", namespace); select = typeCheck("select", select); separator = typeCheck("separator", separator); super.validate(); }
private boolean mayInvolveCastToQName(TypeHierarchy th, Expression e1, Expression e2) { SimpleType s1 = (SimpleType) e1.getItemType().getAtomizedItemType(); return (s1 == BuiltInAtomicType.ANY_ATOMIC || s1.isNamespaceSensitive()) && th.relationship(e2.getItemType().getAtomizedItemType(), BuiltInAtomicType.UNTYPED_ATOMIC) != TypeHierarchy.DISJOINT && (e2.getSpecialProperties() & StaticProperty.NOT_UNTYPED_ATOMIC) == 0; }
public void validate() throws XPathException { if (schemaType != null) { if (schemaType.isNamespaceSensitive()) { compileError("Validation at attribute level must not specify a " + "namespace-sensitive type (xs:QName or xs:NOTATION)", "XTTE1545"); } } attributeName = typeCheck("name", attributeName); namespace = typeCheck("namespace", namespace); select = typeCheck("select", select); separator = typeCheck("separator", separator); super.validate(); }
public void validate(ComponentDeclaration decl) throws XPathException { if (schemaType != null) { if (schemaType.isNamespaceSensitive()) { compileErrorInAttribute("Validation at attribute level must not specify a " + "namespace-sensitive type (xs:QName or xs:NOTATION)", "XTTE1545", "type"); } } attributeName = typeCheck("name", attributeName); namespace = typeCheck("namespace", namespace); select = typeCheck("select", select); separator = typeCheck("separator", separator); //onEmpty = typeCheck("on-empty", onEmpty); super.validate(decl); }
public void validate() throws XPathException { if (schemaType != null) { if (schemaType.isNamespaceSensitive()) { compileError("Validation at attribute level must not specify a " + "namespace-sensitive type (xs:QName or xs:NOTATION)", "XTTE1545"); } } attributeName = typeCheck("name", attributeName); namespace = typeCheck("namespace", namespace); select = typeCheck("select", select); separator = typeCheck("separator", separator); super.validate(); }
public void validate(ComponentDeclaration decl) throws XPathException { if (schemaType != null) { if (schemaType.isNamespaceSensitive()) { compileErrorInAttribute("Validation at attribute level must not specify a " + "namespace-sensitive type (xs:QName or xs:NOTATION)", "XTTE1545", "type"); } } attributeName = typeCheck("name", attributeName); namespace = typeCheck("namespace", namespace); select = typeCheck("select", select); separator = typeCheck("separator", separator); //onEmpty = typeCheck("on-empty", onEmpty); super.validate(decl); }
/** * Check whether the content of an attribute is namespace-sensitive * * * @param type the type annotation of the node * @param nodeNr the the node number of the elemente * @throws XPathException if an error occurs */ private void checkNotNamespaceSensitiveAttribute(SimpleType type, int nodeNr) throws XPathException { if (type.isNamespaceSensitive()) { if (type.isAtomicType()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } else { // For a union or list type, we need to check whether the actual value is namespace-sensitive AtomicSequence value = tree.getTypedValueOfAttribute(null, nodeNr); for (AtomicValue val : value) { if (val.getPrimitiveType().isNamespaceSensitive()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } } } } }
/** * Check whether the content of an element is namespace-sensitive * * * @param type the type annotation of the node * @param nodeNr the the node number of the elemente * @throws XPathException if an error occurs */ protected void checkNotNamespaceSensitiveElement(SchemaType type, int nodeNr) throws XPathException { if (type instanceof SimpleType && ((SimpleType) type).isNamespaceSensitive()) { if (type.isAtomicType()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } else { // For a union or list type, we need to check whether the actual value is namespace-sensitive AtomicSequence value = tree.getTypedValueOfElement(nodeNr); for (AtomicValue val : value) { if (val.getPrimitiveType().isNamespaceSensitive()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } } } } }
/** * Check whether the content of an element is namespace-sensitive * * * @param type the type annotation of the node * @param nodeNr the the node number of the elemente * @throws XPathException if an error occurs */ protected void checkNotNamespaceSensitiveElement(SchemaType type, int nodeNr) throws XPathException { if (type instanceof SimpleType && ((SimpleType) type).isNamespaceSensitive()) { if (type.isAtomicType()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } else { // For a union or list type, we need to check whether the actual value is namespace-sensitive AtomicSequence value = tree.getTypedValueOfElement(nodeNr); for (AtomicValue val : value) { if (val.getPrimitiveType().isNamespaceSensitive()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } } } } }
/** * Check whether the content of an attribute is namespace-sensitive * * * @param type the type annotation of the node * @param nodeNr the the node number of the elemente * @throws XPathException if an error occurs */ private void checkNotNamespaceSensitiveAttribute(SimpleType type, int nodeNr) throws XPathException { if (type.isNamespaceSensitive()) { if (type.isAtomicType()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } else { // For a union or list type, we need to check whether the actual value is namespace-sensitive AtomicSequence value = tree.getTypedValueOfAttribute(null, nodeNr); for (AtomicValue val : value) { if (val.getPrimitiveType().isNamespaceSensitive()) { throw new CopyNamespaceSensitiveException( "Cannot copy QName or NOTATION values without copying namespaces"); } } } } }
final ConversionRules rules = config.getConversionRules(); final Converter untypedConverter; if (((SimpleType) requiredItemType).isNamespaceSensitive()) { throw new XPathException("Cannot convert untyped atomic values to a namespace-sensitive type", "XPTY0117");
stype = ((ComplexType) parentType).getSimpleContentType(); if (stype != null && !stype.isNamespaceSensitive()) {