declaredNS.add(attr.getNamespace());
Namespace ns = attribute.getNamespace(); if (ns != null && ns != Namespace.NO_NAMESPACE && ns != Namespace.XML_NAMESPACE) { String prefix = ns.getPrefix();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace(); if (ns != null && ns != Namespace.NO_NAMESPACE && ns != Namespace.XML_NAMESPACE) { String prefix = ns.getPrefix();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace();
Namespace ns = attribute.getNamespace();
for (int i = 0; i < element.attributeCount(); i++) { Attribute attr = element.attribute(i); int index = findNamespaceIndex(attr.getNamespace()); m_xmlWriter.addAttribute(index, attr.getName(), attr.getValue());
protected void testAttributeDefaultPrefix(Document document) throws Exception { List<Node> list = document.selectNodes("//@*[local-name()='actor']"); assertTrue("Matched at least one 'actor' attribute", list.size() > 0); for (Node node : list) { Attribute attribute = (Attribute) node; log("found: " + attribute.asXML()); Element element = attribute.getParent(); assertTrue("Attribute has a parent", element != null); Namespace ns = element.getNamespaceForPrefix(""); String uri = "http://schemas.xmlsoap.org/soap/envelope/"; assertNamespace(ns, "", uri); Namespace ns2 = attribute.getNamespace(); // Note that namespaces do not inherit the default namespace! assertNamespace(ns2, "", ""); } }