public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeName(i); if (!contains(name)) { addAttribute(name, attributes.getValue(i), XmlViolationPolicy.ALLOW); } } }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeNameNoBoundsCheck(i); if (!contains(name)) { addAttribute(name, attributes.getValueNoBoundsCheck(i), XmlViolationPolicy.ALLOW); } } } }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeNameNoBoundsCheck(i); if (!contains(name)) { addAttribute(name, attributes.getValueNoBoundsCheck(i), XmlViolationPolicy.ALLOW); } } } }
private void attributeNameComplete() throws SAXException { // if (strBufOffset != -1) { // attributeName = AttributeName.nameByBuffer(buf, strBufOffset, // strBufLen, namePolicy != XmlViolationPolicy.ALLOW); // } else { attributeName = AttributeName.nameByBuffer(strBuf, 0, strBufLen // [NOCPP[ , namePolicy != XmlViolationPolicy.ALLOW // ]NOCPP] , interner); // } if (attributes == null) { attributes = new HtmlAttributes(mappingLangToXmlLang); } /* * When the user agent leaves the attribute name state (and before * emitting the tag token, if appropriate), the complete attribute's * name must be compared to the other attributes on the same token; if * there is already an attribute on the token with the exact same name, * then this is a parse error and the new attribute must be dropped, * along with the value that gets associated with it (if any). */ if (attributes.contains(attributeName)) { errDuplicateAttribute(); attributeName.release(); attributeName = null; } }
private void attributeNameComplete() throws SAXException { attributeName = AttributeName.nameByBuffer(strBuf, strBufLen, interner); if (attributeName == null) { // [NOCPP[ attributeName = AttributeName.createAttributeName( Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner), namePolicy != XmlViolationPolicy.ALLOW); // ]NOCPP] // CPPONLY: nonInternedAttributeName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner)); // CPPONLY: attributeName = nonInternedAttributeName; } clearStrBufAfterUse(); if (attributes == null) { attributes = new HtmlAttributes(mappingLangToXmlLang); } /* * When the user agent leaves the attribute name state (and before * emitting the tag token, if appropriate), the complete attribute's * name must be compared to the other attributes on the same token; if * there is already an attribute on the token with the exact same name, * then this is a parse error and the new attribute must be dropped, * along with the value that gets associated with it (if any). */ if (attributes.contains(attributeName)) { errDuplicateAttribute(); attributeName = null; } }
private void attributeNameComplete() throws SAXException { attributeName = AttributeName.nameByBuffer(strBuf, strBufLen, interner); if (attributeName == null) { // [NOCPP[ attributeName = AttributeName.createAttributeName( Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner), namePolicy != XmlViolationPolicy.ALLOW); // ]NOCPP] // CPPONLY: nonInternedAttributeName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner)); // CPPONLY: attributeName = nonInternedAttributeName; } clearStrBufAfterUse(); if (attributes == null) { attributes = new HtmlAttributes(mappingLangToXmlLang); } /* * When the user agent leaves the attribute name state (and before * emitting the tag token, if appropriate), the complete attribute's * name must be compared to the other attributes on the same token; if * there is already an attribute on the token with the exact same name, * then this is a parse error and the new attribute must be dropped, * along with the value that gets associated with it (if any). */ if (attributes.contains(attributeName)) { errDuplicateAttribute(); attributeName = null; } }