public int getAttributeCount() { return currentElement.getAttributes().size(); }
public String getAttribute(int index) { return currentElement.getAttributes().get(index).getValue(); }
public String getAttributeName(int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
@SuppressWarnings( "unchecked" ) private void appendElement( Element source, Element target ) { for ( Iterator<Attribute> itr = source.getAttributes().iterator(); itr.hasNext(); ) { Attribute a = itr.next(); itr.remove(); Attribute mergedAtt = target.getAttribute( a.getName(), a.getNamespace() ); if ( mergedAtt == null ) { target.setAttribute( a ); } } for ( Iterator<Element> itr = source.getChildren().iterator(); itr.hasNext(); ) { Content n = itr.next(); itr.remove(); target.addContent( n ); } }
@Override public final Iterator<?> getAttributeAxisIterator(Object contextNode) throws UnsupportedAxisException { if (isElement(contextNode) && ((Element)contextNode).hasAttributes()) { return ((Element)contextNode).getAttributes().iterator(); } return JaxenConstants.EMPTY_ITERATOR; }
for (Attribute att : getAttributes()) { Namespace ns = att.getNamespace(); if (!namespaces.containsKey(ns.getPrefix())) {
for (Attribute a : getAttributes()) { final String reason = Verifier.checkNamespaceCollision(namespace, a);
/** * @return list {@link Attribute} */ public List getAttributes() { return element.getAttributes(); }
reason = checkNamespaceCollision(namespace, element.getAttributes()); if (reason != null) { return reason;
for (Attribute att : element.getAttributes()) { final org.w3c.dom.Attr a = printAttribute(fstack, basedoc, att); if (a != null) {
for (final Attribute a : element.getAttributes()) { final Namespace ns = a.getNamespace(); if (ns == Namespace.NO_NAMESPACE) {
for (final Attribute attribute : element.getAttributes()) { printAttribute(out, fstack, attribute); for (final Attribute attribute : element.getAttributes()) { printAttribute(out, fstack, attribute);
for (Attribute a : element.getAttributes()) { if (!a.isSpecified() && fstack.isSpecifiedAttributesOnly()) { continue;
element.getAttributes().iterator() : null; if (ns == Namespace.NO_NAMESPACE) {
@Override public String getAttributeName(final int index) { return decodeAttribute(currentElement.getAttributes().get(index).getQualifiedName()); }
public Attribute text2attribute(String text) { String xtext = "<x " + text + " />"; return text2element(xtext).getAttributes().get(0).detach(); } }
public static MCRChangeData setText(Element element, String text) { Element clone = element.clone(); for (Iterator<Attribute> attributes = clone.getAttributes().iterator(); attributes.hasNext();) { attributes.next(); attributes.remove(); } MCRChangeData data = new MCRChangeData("set-text", clone, 0, element); element.setText(text); return data; }
for (final Attribute attribute : element.getAttributes()) { printAttribute(out, fstack, attribute);
private static boolean areElementsEqual(Element e1, Element e2) { if (e1 == null && e2 == null) return true; //noinspection SimplifiableIfStatement if (e1 == null || e2 == null) return false; return StringUtil.equal(e1.getName(), e2.getName()) && attListsEqual(e1.getAttributes(), e2.getAttributes()) && contentListsEqual(e1.getContent(CONTENT_FILTER), e2.getContent(CONTENT_FILTER)); }
/** * Copies those attributes from the other's element into this' element that do not exist in this' element. */ protected void mergeAttributes(MCRMerger other) { for (Attribute attribute : other.element.getAttributes()) { if (this.element.getAttribute(attribute.getName(), attribute.getNamespace()) == null) { this.element.setAttribute(attribute.clone()); } } }