public int getIndex(String qName) { return fAttributes.getIndex(qName); }
public int getIndex(String qName) { return fAttributes.getIndex(qName); }
/** * <p> * getIndex * </p> * * @param arg0 * @return */ public int getIndex( String qName ) { return attrs.getIndex(asNekoAttributeName(qName)); } /**
/** * <p> * getIndex * </p> * * @param arg0 * @return */ public int getIndex( String qName ) { return attrs.getIndex(asNekoAttributeName(qName)); } /**
/** * <p> * getIndex * </p> * * @param arg0 * @param arg1 * @return */ public int getIndex( String uri, String localName ) { return attrs.getIndex(uri,asNekoAttributeName(localName)); } /**
/** * <p> * getIndex * </p> * * @param arg0 * @param arg1 * @return */ public int getIndex( String uri, String localName ) { return attrs.getIndex(uri,asNekoAttributeName(localName)); } /**
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); } }
public TypeInfo getAttributeTypeInfo(String attributeUri, String attributeLocalName) { checkStateAttribute(); return getAttributeTypeInfo(fAttributes.getIndex(attributeUri,attributeLocalName)); }
public TypeInfo getAttributeTypeInfo(String attributeQName) { checkStateAttribute(); return getAttributeTypeInfo(fAttributes.getIndex(attributeQName)); }
public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException { element.localpart = element.localpart == null ? null : element.localpart.toLowerCase(); element.prefix = element.prefix == null ? null : element.prefix.toLowerCase(); element.uri = element.uri == null ? null : element.uri.toLowerCase(); element.rawname = element.rawname == null ? null : element.rawname.toLowerCase(); // Handle the font tag, if ("font".equals(element.localpart)) { String attrName = "color"; moveAttributeToStyle(attributes, attrName, "color:%1$s;"); } else if (element.localpart.equals("style")) { String id = attributes.getValue("id"); if (id == null || !id.equals(RenderedXhtmlBuilder.MAIN_STYLE_ID)) { styleStack.push(element); insideStyle = true; } } else if (element.localpart.equals("a")) { int hrefIdx = attributes.getIndex("href"); if (hrefIdx != -1) { String href = attributes.getValue(hrefIdx); if (!StringUtils.isBlank(href)) { String newHref = linkFixer.convertLink(href); if (newHref != null) { attributes.setValue(hrefIdx, newHref); } } } } super.startElement(element, attributes, augs); }
private void moveAttributeToStyle(XMLAttributes attributes, String attrName, String formatStr) { String attrValue = attributes.getValue(attrName); if (!StringUtils.isEmpty(attrValue)) { String newStyle = String.format(formatStr, attrValue); int styleIdx = attributes.getIndex("style"); if (styleIdx != -1) { String style = attributes.getValue(styleIdx); newStyle = newStyle + style; attributes.setValue(styleIdx, newStyle); } else { attributes.addAttribute(new QName(null, "style", "style", null), "CDATA", newStyle); } } }
attrs.removeAttributeAt(attrs.getIndex("type")); super.startElement(currentOsmlTag, attrs, augs); return;
attrs.removeAttributeAt(attrs.getIndex("type")); super.startElement(currentOsmlTag, attrs, augs); return;
for( int i=0; i<len; i++ ) { String aqn = atts.getQName(i); int j = fCurrentAttributes.getIndex(aqn); String av = atts.getValue(i); if(j==-1) {
alreadyDeclared = atts.getIndex(a.namespace, a.localName) >= 0; if(! alreadyDeclared) { if("".equals(a.namespace)) { alreadyDeclared = atts.getIndex(null, a.localName) >= 0; if (atts.getIndex(rawname) < 0) { QName attName = new QName(fSymbolTable.addSymbol(prefix), fSymbolTable.addSymbol(a.localName), fSymbolTable.addSymbol(rawname), fSymbolTable.addSymbol(a.namespace)); atts.addAttribute(attName, "CDATA", a.value); int attrIndex = atts.getIndex(attName.uri, attName.localpart); atts.setSpecified(attrIndex, false); fSymbolTable.addSymbol(a.namespace)); atts.addAttribute(attName, "CDATA", a.value); int attrIndex = atts.getIndex(attName.uri, attName.localpart); atts.setSpecified(attrIndex, false); QName attName = new QName(null, attname, attname, null); atts.addAttribute(attName, "CDATA", a.value); int attrIndex = atts.getIndex(attname); atts.setSpecified(attrIndex, false);