/** * <p> * removeAttributeAt * </p> * * @param arg0 */ public void removeAttributeAt( int arg0 ) { attrs.removeAttributeAt(arg0); } /**
/** * <p> * removeAttributeAt * </p> * * @param arg0 */ public void removeAttributeAt( int arg0 ) { attrs.removeAttributeAt(arg0); } /**
public class RemoveStyleFilter extends DefaultFilter { @Override public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException { for (String forbidden : new String[] {"class", "style"}) { int index = attributes.getIndex(forbidden); if (index >= 0) { attributes.removeAttributeAt(index); } } super.startElement(element, attributes, augs); } }
/** * <p> * addAttribute * </p> * * @param arg0 * @param arg1 * @param arg2 * @return */ public int addAttribute( QName arg0, String arg1, String arg2 ) { int i = getIndex( arg0.rawname ); if ( i >= 0 ) attrs.removeAttributeAt( i ); return attrs.addAttribute( arg0, arg1, arg2 ); } /**
/** * <p> * addAttribute * </p> * * @param arg0 * @param arg1 * @param arg2 * @return */ public int addAttribute( QName arg0, String arg1, String arg2 ) { int i = getIndex( arg0.rawname ); if ( i >= 0 ) attrs.removeAttributeAt( i ); return attrs.addAttribute( arg0, arg1, arg2 ); } /**
/** * Handles an open tag. */ protected boolean handleOpenTag(QName element, XMLAttributes attributes) { if (elementAccepted(element.rawname)) { Object key = element.rawname.toLowerCase(); Object value = fAcceptedElements.get(key); if (value != NULL) { String[] anames = (String[]) value; int attributeCount = attributes.getLength(); LOOP: for (int i = 0; i < attributeCount; i++) { String aname = attributes.getQName(i).toLowerCase(); for (int j = 0; j < anames.length; j++) { if (anames[j].equals(aname)) { continue LOOP; } } attributes.removeAttributeAt(i--); attributeCount--; } } else { attributes.removeAllAttributes(); } return true; } else if (elementRemoved(element.rawname)) { fRemovalElementDepth = fElementDepth; } return false; } // handleOpenTag(QName,XMLAttributes):boolean
/** Handles an open tag. */ protected boolean handleOpenTag(QName element, XMLAttributes attributes) { if (elementAccepted(element.rawname)) { Object key = element.rawname.toLowerCase(); Object value = fAcceptedElements.get(key); if (value != NULL) { String[] anames = (String[])value; int attributeCount = attributes.getLength(); LOOP: for (int i = 0; i < attributeCount; i++) { String aname = attributes.getQName(i).toLowerCase(); for (int j = 0; j < anames.length; j++) { if (anames[j].equals(aname)) { continue LOOP; } } attributes.removeAttributeAt(i--); attributeCount--; } } else { attributes.removeAllAttributes(); } return true; } else if (elementRemoved(element.rawname)) { fRemovalElementDepth = fElementDepth; } return false; } // handleOpenTag(QName,XMLAttributes):boolean
/** Handles an open tag. */ protected boolean handleOpenTag(QName element, XMLAttributes attributes) { if (elementAccepted(element.rawname)) { Object key = element.rawname.toLowerCase(); Object value = fAcceptedElements.get(key); if (value != NULL) { String[] anames = (String[])value; int attributeCount = attributes.getLength(); LOOP: for (int i = 0; i < attributeCount; i++) { String aname = attributes.getQName(i).toLowerCase(); for (int j = 0; j < anames.length; j++) { if (anames[j].equals(aname)) { continue LOOP; } } attributes.removeAttributeAt(i--); attributeCount--; } } else { attributes.removeAllAttributes(); } return true; } else if (elementRemoved(element.rawname)) { fRemovalElementDepth = fElementDepth; } return false; } // handleOpenTag(QName,XMLAttributes):boolean
/** * Handles an open tag. */ protected boolean handleOpenTag(QName element, XMLAttributes attributes) { if (elementAccepted(element.rawname)) { Object key = element.rawname.toLowerCase(); Object value = fAcceptedElements.get(key); if (value != NULL) { String[] anames = (String[]) value; int attributeCount = attributes.getLength(); LOOP: for (int i = 0; i < attributeCount; i++) { String aname = attributes.getQName(i).toLowerCase(); for (int j = 0; j < anames.length; j++) { if (anames[j].equals(aname)) { continue LOOP; } } attributes.removeAttributeAt(i--); attributeCount--; } } else { attributes.removeAllAttributes(); } return true; } else if (elementRemoved(element.rawname)) { fRemovalElementDepth = fElementDepth; } return false; } // handleOpenTag(QName,XMLAttributes):boolean
attrs.removeAttributeAt(attrs.getIndex("type")); super.startElement(currentOsmlTag, attrs, augs); return;
attrs.removeAttributeAt(attrs.getIndex("type")); super.startElement(currentOsmlTag, attrs, augs); return;
/** * The start of an element. If the document specifies the start element * by using an empty tag, then the startElement method will immediately * be followed by the endElement method, with no intervening methods. * Overriding the parent to handle DOM_NAMESPACE_DECLARATIONS=false. * * @param element The name of the element. * @param attributes The element attributes. * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */ public void startElement (QName element, XMLAttributes attributes, Augmentations augs) { // namespace declarations parameter has no effect if namespaces is false. if (!fNamespaceDeclarations && fNamespaceAware) { int len = attributes.getLength(); for (int i = len - 1; i >= 0; --i) { if (XMLSymbols.PREFIX_XMLNS == attributes.getPrefix(i) || XMLSymbols.PREFIX_XMLNS == attributes.getQName(i)) { attributes.removeAttributeAt(i); } } } super.startElement(element, attributes, augs); }
(fQName.rawname == XMLSymbols.PREFIX_XMLNS)) { attributes.removeAttributeAt(i);