new NameTest(Type.ELEMENT, nodeName, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, typeCode, getConfiguration(), false)); checkAllowsMany(location); long key = (long) nodeName.obtainFingerprint(getNamePool()) << 32 | (long) typeCode.getFingerprint(); if (!checkedElements.contains(key)) { ItemType type = new CombinedNodeTest( new NameTest(Type.ELEMENT, nodeName, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, typeCode, getConfiguration(), false));
new NameTest(Type.ELEMENT, nodeName, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, typeCode, getConfiguration(), false)); checkAllowsMany(location); long key = (long) nodeName.obtainFingerprint(getNamePool()) << 32 | (long) typeCode.getFingerprint(); if (!checkedElements.contains(key)) { ItemType type = new CombinedNodeTest( new NameTest(Type.ELEMENT, nodeName, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, typeCode, getConfiguration(), false));
private void checkItemType(ItemType type, long locationId) throws XPathException { if (!getConfiguration().getTypeHierarchy().isSubType(type, itemType)) { String message = role.composeErrorMessage(itemType, type, getNamePool()); String errorCode = role.getErrorCode(); XPathException err = new XPathException(message); err.setErrorCode(errorCode); if (!"XPDY0050".equals(errorCode)) { err.setIsTypeError(true); } err.setLocator(ExpressionLocation.getSourceLocator(locationId, getPipelineConfiguration().getLocationProvider())); throw err; } }
private void checkItemType(ItemType type, long locationId) throws XPathException { if (!getConfiguration().getTypeHierarchy().isSubType(type, itemType)) { String message = role.composeErrorMessage(itemType, type, getNamePool()); String errorCode = role.getErrorCode(); XPathException err = new XPathException(message); err.setErrorCode(errorCode); if (!"XPDY0050".equals(errorCode)) { err.setIsTypeError(true); } err.setLocator(ExpressionLocation.getSourceLocator(locationId, getPipelineConfiguration().getLocationProvider())); throw err; } }
new NameTest(Type.ELEMENT, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, getConfiguration().getSchemaType(typeCode), getConfiguration())); if (!checkedElements.contains(key)) { ItemType type = new CombinedNodeTest( new NameTest(Type.ELEMENT, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, getConfiguration().getSchemaType(typeCode), getConfiguration()));
new NameTest(Type.ELEMENT, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, getConfiguration().getSchemaType(typeCode), getConfiguration())); if (!checkedElements.contains(key)) { ItemType type = new CombinedNodeTest( new NameTest(Type.ELEMENT, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ELEMENT, getConfiguration().getSchemaType(typeCode), getConfiguration()));
/** * Notify an attribute. Attributes are notified after the startElement event, and before any * children. Namespaces and attributes may be intermingled. * * @param nameCode The name of the attribute * @param typeCode The type of the attribute * @param locationId the location of the node in the source, or of the instruction that created it * @param properties Bit significant value. The following bits are defined: * <dl> * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt> * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt> * </dl> * @throws IllegalStateException: attempt to output an attribute when there is no open element * start tag */ public void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, Location locationId, int properties) throws XPathException { if (level == 0) { if (++count == 2) { checkAllowsMany(locationId); } ItemType type = new CombinedNodeTest( new NameTest(Type.ATTRIBUTE, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ATTRIBUTE, typeCode, getConfiguration(), false)); checkItemType(type, nodeSupplier(Type.ATTRIBUTE, nameCode, value), locationId); } nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); }
/** * Notify an attribute. Attributes are notified after the startElement event, and before any * children. Namespaces and attributes may be intermingled. * * @param nameCode The name of the attribute * @param typeCode The type of the attribute * @param locationId the location of the node in the source, or of the instruction that created it * @param properties Bit significant value. The following bits are defined: * <dl> * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt> * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt> * </dl> * @throws IllegalStateException: attempt to output an attribute when there is no open element * start tag */ public void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, Location locationId, int properties) throws XPathException { if (level == 0) { if (++count == 2) { checkAllowsMany(locationId); } ItemType type = new CombinedNodeTest( new NameTest(Type.ATTRIBUTE, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ATTRIBUTE, typeCode, getConfiguration(), false)); checkItemType(type, nodeSupplier(Type.ATTRIBUTE, nameCode, value), locationId); } nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); }
/** * Notify an attribute. Attributes are notified after the startElement event, and before any * children. Namespaces and attributes may be intermingled. * * @param nameCode The name of the attribute, as held in the name pool * @param typeCode The type of the attribute, as held in the name pool * @param properties Bit significant value. The following bits are defined: * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt> * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt> * @throws IllegalStateException: attempt to output an attribute when there is no open element * start tag */ public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException { if (level == 0) { if (++count == 2) { checkAllowsMany(locationId); } ItemType type = new CombinedNodeTest( new NameTest(Type.ATTRIBUTE, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ATTRIBUTE, getConfiguration().getSchemaType(typeCode), getConfiguration())); checkItemType(type, locationId); } nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); }
/** * Notify an attribute. Attributes are notified after the startElement event, and before any * children. Namespaces and attributes may be intermingled. * * @param nameCode The name of the attribute, as held in the name pool * @param typeCode The type of the attribute, as held in the name pool * @param properties Bit significant value. The following bits are defined: * <dd>DISABLE_ESCAPING</dd> <dt>Disable escaping for this attribute</dt> * <dd>NO_SPECIAL_CHARACTERS</dd> <dt>Attribute value contains no special characters</dt> * @throws IllegalStateException: attempt to output an attribute when there is no open element * start tag */ public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException { if (level == 0) { if (++count == 2) { checkAllowsMany(locationId); } ItemType type = new CombinedNodeTest( new NameTest(Type.ATTRIBUTE, nameCode, getNamePool()), Token.INTERSECT, new ContentTypeTest(Type.ATTRIBUTE, getConfiguration().getSchemaType(typeCode), getConfiguration())); checkItemType(type, locationId); } nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); }