attName = checkProposedPrefix(attName, attCount++);
attName = checkProposedPrefix(attName, attCount++);
/** * 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 (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.ATTRIBUTE, getNamePool().getDisplayName(nameCode), getPipelineConfiguration().getHostLanguage(), inDocument, false); } // Perform namespace fixup for the attribute if (((properties & ReceiverOptions.NAMESPACE_OK) == 0) && NamePool.getPrefixIndex(nameCode) != 0) { // non-null prefix nameCode = checkProposedPrefix(nameCode, attCount++); } bufferedAttributes.addAttribute(nameCode, typeCode, value.toString(), locationId, properties); // Note: we're relying on the fact that AttributeCollection can hold two attributes of the same name // and maintain their order, because the check for duplicate attributes is not done until later in the // pipeline. We validate both the attributes (see Bugzilla #4600 which legitimizes this.) }
/** * 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 (!acceptAttributes) { throw NoOpenStartTagException.makeNoOpenStartTagException( Type.ATTRIBUTE, getNamePool().getDisplayName(nameCode), getPipelineConfiguration().getHostLanguage(), inDocument, false); } // Perform namespace fixup for the attribute if (((properties & ReceiverOptions.NAMESPACE_OK) == 0) && NamePool.getPrefixIndex(nameCode) != 0) { // non-null prefix nameCode = checkProposedPrefix(nameCode, attCount++); } bufferedAttributes.addAttribute(nameCode, typeCode, value.toString(), locationId, properties); // Note: we're relying on the fact that AttributeCollection can hold two attributes of the same name // and maintain their order, because the check for duplicate attributes is not done until later in the // pipeline. We validate both the attributes (see Bugzilla #4600 which proposes to legitimize this.) }