public String getAttributeName(Object obj) { Attribute attr = (Attribute) obj; return attr.getName(); }
String attName = attribute.getName(); if (attName.startsWith("xmlns:")) { String prefix = attName.substring(6);
protected Attribute attribute(String namespaceURI, String localName) { List<Attribute> attributes = attributeList(); int size = attributes.size(); for (Attribute attribute : attributes) { if (localName.equals(attribute.getName()) && (((namespaceURI == null || namespaceURI.length() == 0) && ((attribute.getNamespaceURI() == null) || (attribute.getNamespaceURI().length() == 0))) || ((namespaceURI != null) && namespaceURI .equals(attribute.getNamespaceURI())))) { return attribute; } } return null; }
@Override protected void match(Node node) { // System.out.println(node.toString()); if (node instanceof Element) { Element element = (Element) node; System.out.println("Element: " + element.getQualifiedName()); System.out.println("\tText: " + element.getText()); System.out.println("\tAttributes:"); for (Iterator<?> i = element.attributeIterator(); i.hasNext();) { Attribute attribute = (Attribute) i.next(); System.out.println("\t\t" + attribute.getName() + "=" + attribute.getValue()); } } else if (node instanceof Attribute) { Attribute attribute = (Attribute) node; System.out.println("Attribute: " + attribute.getName() + "=" + attribute.getValue()); } } };
public String getAttributeValueFromName(String namespaceURI, String localName) { if (element != null) { for (Iterator<Attribute> iter = element.attributeIterator(); iter.hasNext();) { Attribute attribute = iter.next(); if (namespaceURI.equals(attribute.getNamespaceURI()) && localName.equals(attribute.getName())) { return attribute.getValue(); } } } return null; }
String attName = attribute.getName();
private void setAttributeField( Attribute attribute, IProgressMonitor monitor ) { String attributname = attribute.getName(); String attributnametxt = cleanString( attribute.getPath() ); if ( !Utils.isEmpty( attributnametxt ) && !list.contains( attribute.getPath() ) ) {
protected Attributes createAttributes(Element element, Attributes namespaceAttributes) throws SAXException { attributes.clear(); if (namespaceAttributes != null) { attributes.setAttributes(namespaceAttributes); } for (Iterator<Attribute> iter = element.attributeIterator(); iter.hasNext();) { Attribute attribute = iter.next(); attributes.addAttribute(attribute.getNamespaceURI(), attribute .getName(), attribute.getQualifiedName(), "CDATA", attribute.getValue()); } return attributes; }
public Attribute attribute(String name) { final Object attributesShadow = this.attributes; if (attributesShadow instanceof List) { List<Attribute> list = (List<Attribute>) attributesShadow; for (Attribute attribute : list) { if (name.equals(attribute.getName())) { return attribute; } } } else if (attributesShadow != null) { Attribute attribute = (Attribute) attributesShadow; if (name.equals(attribute.getName())) { return attribute; } } return null; }
public String getAttributeValueFromName(String namespaceURI, String localName) { if (element != null) { for (Iterator<Attribute> iter = element.attributeIterator(); iter.hasNext();) { Attribute attribute = iter.next(); if (namespaceURI.equals(attribute.getNamespaceURI()) && localName.equals(attribute.getName())) { return attribute.getValue(); } } } return null; }
public String getAttributeLocalName(int index) { if (element != null) { Attribute attribute = element.attribute(index); if (attribute != null) { return attribute.getName(); } } return null; }
public Attribute attribute(String name) { for (Attribute attribute : attributeList()) { if (name.equals(attribute.getName())) { return attribute; } } return null; }
public Attribute attribute(String name) { for (Attribute attribute : attributeList()) { if (name.equals(attribute.getName())) { return attribute; } } return null; }
public String getAttributeLocalName(int index) { if (element != null) { Attribute attribute = element.attribute(index); if (attribute != null) { return attribute.getName(); } } return null; }
public String getAttributeLocalName(int index) { if (element != null) { Attribute attribute = element.attribute(index); if (attribute != null) { return attribute.getName(); } } return null; }
public Attribute attribute(String name) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (name.equals(attribute.getName())) { return attribute; } } return null; }
public String getAttributeLocalName(int index) { if (element != null) { Attribute attribute = element.attribute(index); if (attribute != null) { return attribute.getName(); } } return null; }
public String getAttributeLocalName(int index) { if (element != null) { Attribute attribute = element.attribute(index); if (attribute != null) { return attribute.getName(); } } return null; }
public Attribute attribute(String name) { List list = attributeList(); int size = list.size(); for (int i = 0; i < size; i++) { Attribute attribute = (Attribute) list.get(i); if (name.equals(attribute.getName())) { return attribute; } } return null; }
private List<KeyValueStore> getAttribute(Element element) { List attributes = new ArrayList(); Iterator iterator = element.attributeIterator(); while (iterator.hasNext()) { Attribute attribute = (Attribute) iterator.next(); String attributeName = attribute.getName(); String attributeValue = attribute.getValue(); attributes.add(new KeyValueStore(attributeName, attributeValue)); } return attributes; }