public int getAttributeCount() { return currentElement.getAttributeCount(); }
public Iterator getAttributeAxisIterator(Object o) { if (isElement(o)) { return new IndexIterator(o, 0, ((Element)o).getAttributeCount()) { public Object get(Object o, int i) { return ((Element)o).getAttribute(i); } }; } return JaxenConstants.EMPTY_ITERATOR; }
@Override public int getAttributeCount() { return currentElement.getAttributeCount(); }
public int getAttributeCount() { return currentElement.getAttributeCount(); }
public int getAttributeCount() { return currentElement.getAttributeCount(); }
public int getAttributeCount() { return currentElement.getAttributeCount(); }
public int getAttributeCount() { return currentElement.getAttributeCount(); }
private void substituteAttributes(Element element) { // make a copy of attribute lists as we are resetting them int attCount = element.getAttributeCount(); List<Attribute> attList = new ArrayList<Attribute>(); for (int j = 0; j < attCount; j++) { Attribute att = element.getAttribute(j); attList.add(att); } for (Attribute att : attList) { this.substituteNameByValue(att); } }
private NodeInfo advance() { Element elem = (Element) start.node; if (cursor == elem.getAttributeCount()) { return null; } NodeInfo curr = makeWrapper(elem.getAttribute(cursor), docWrapper, start, cursor); cursor++; return curr; }
private NodeInfo advance() { Element elem = (Element) start.node; if (cursor == elem.getAttributeCount()) return null; NodeInfo curr = makeWrapper(elem.getAttribute(cursor), docWrapper, start, cursor); cursor++; return curr; }
private NodeInfo advance() { Element elem = (Element) start.node; if (cursor == elem.getAttributeCount()) { return null; } NodeInfo curr = makeWrapper(elem.getAttribute(cursor), docWrapper, start, cursor); cursor++; return curr; }
/** * copies attributes. makes subclass if necessary. * * @param element to copy from */ public void copyAttributesFrom(Element element) { for (int i = 0; i < element.getAttributeCount(); i++) { Attribute att = element.getAttribute(i); Attribute newAtt = (Attribute) att.copy(); this.addAttribute(newAtt); } }
public void moveAttributesTo(Element element) { for (int i=0; i<xomElement.getAttributeCount(); i++) { Attribute attribute = xomElement.getAttribute(i); xomElement.removeAttribute(attribute); element.xomElement.addAttribute(attribute); } }
public void moveAttributesTo(Element element) { for (int i=0; i<xomElement.getAttributeCount(); i++) { Attribute attribute = xomElement.getAttribute(i); xomElement.removeAttribute(attribute); element.xomElement.addAttribute(attribute); } }
/** * copies atributes of 'from' to 'to' * @param element */ public static void copyAttributes(Element from, Element to) { int natt = from.getAttributeCount(); for (int i = 0; i < natt; i++) { Attribute newAtt = new Attribute(from.getAttribute(i)); to.addAttribute(newAtt); } }
protected void processUnexpectedAttributes(Element element, List<SwordValidationInfo> attributeItems) { int attributeCount = element.getAttributeCount(); Attribute attribute = null; for (int i = 0; i < attributeCount; i++) { attribute = element.getAttribute(i); XmlName attributeName = new XmlName(attribute.getNamespacePrefix(), attribute.getLocalName(), attribute.getNamespaceURI()); SwordValidationInfo info = new SwordValidationInfo(xmlName, attributeName, SwordValidationInfo.UNKNOWN_ATTRIBUTE, SwordValidationInfoType.INFO); info.setContentDescription(attribute.getValue()); attributeItems.add(info); } }
public DefaultField(Element elm) { this.name = elm.getLocalName(); this.namespace = elm.getNamespaceURI(); this.prefix = elm.getNamespacePrefix(); for(int i = 0; i<elm.getAttributeCount(); i++) { Attribute attribute = elm.getAttribute(i); fields.add(new DefaultField(attribute.getNamespaceURI(), attribute.getNamespacePrefix(), attribute.getLocalName(), attribute.getValue())); } this.content = XmlUtil.innerToString(elm); }
final void writeStartTag(Element elem) { writeIndex(elem.getNamespacePrefix(), elem.getLocalName()); int type = BEGIN_ELEMENT; if (elem.getNamespaceURI().length() == 0) { type = Util.noNamespace(type); } else { writeIndex(elem.getNamespaceURI()); } nodeTokens.add((byte)type); for (int i = 0; i < elem.getAttributeCount(); i++) { writeAttribute(elem.getAttribute(i)); } writeNamespaceDeclarations(elem); }
final void writeStartTag(Element elem) { writeIndex(elem.getNamespacePrefix(), elem.getLocalName()); int type = BEGIN_ELEMENT; if (elem.getNamespaceURI().length() == 0) { type = Util.noNamespace(type); } else { writeIndex(elem.getNamespaceURI()); } nodeTokens.add((byte)type); for (int i = 0; i < elem.getAttributeCount(); i++) { writeAttribute(elem.getAttribute(i)); } writeNamespaceDeclarations(elem); }
private void processAttributes(final Element inElement, final Element outElement) { for (int i = 0; i < inElement.getAttributeCount(); i++) { final Attribute attr = inElement.getAttribute(i); final String name = attr.getLocalName(); final String value = attr.getValue(); Element attrElement = new Element(xsdPrefix + ":attribute", XSD_NS_URI); attrElement.addAttribute(new Attribute("name", name)); attrElement.addAttribute(new Attribute("type", xsdPrefix + TypeInferenceUtil.getTypeOfContent(value))); attrElement.addAttribute(new Attribute("use", "required")); outElement.appendChild(attrElement); } }