/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; NodeList elemList; NamedNodeMap attributesMap; Attr attr; String prefix; doc = (Document) load("hc_staff", false); elemList = doc.getElementsByTagName("p"); elem = (Element) elemList.item(3); attributesMap = elem.getAttributes(); attr = (Attr) attributesMap.getNamedItem("dir"); prefix = attr.lookupPrefix("http://www.w3.org/1999/xhtml"); assertNull("xhtmlPrefixIsNull", prefix); prefix = attr.lookupPrefix("http://www.altavista.com"); assertEquals("nodelookupprefixB18", "nm", prefix); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; NodeList elemList; NamedNodeMap attributesMap; Attr attr; String prefix; doc = (Document) load("barfoo_nodefaultns", false); elemList = doc.getElementsByTagName("html:p"); elem = (Element) elemList.item(0); attributesMap = elem.getAttributes(); attr = (Attr) attributesMap.getNamedItem("class"); prefix = attr.lookupPrefix("http://www.w3.org/1999/xhtml"); assertEquals("nodelookupprefix19", "html", prefix); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; NodeList elemList; NamedNodeMap attributesMap; Attr attr; String prefix; doc = (Document) load("hc_staff", false); elemList = doc.getElementsByTagName("p"); elem = (Element) elemList.item(3); attributesMap = elem.getAttributes(); attr = (Attr) attributesMap.getNamedItem("xmlns:nm"); prefix = attr.lookupPrefix("http://www.altavista.com"); assertEquals("nodelookupprefix20", "nm", prefix); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; NodeList elemList; NamedNodeMap attributesMap; Attr attr; String prefix; doc = (Document) load("hc_staff", false); elemList = doc.getElementsByTagName("acronym"); elem = (Element) elemList.item(2); attributesMap = elem.getAttributes(); attr = (Attr) attributesMap.getNamedItem("xsi:noNamespaceSchemaLocation"); prefix = attr.lookupPrefix("http://www.netzero.com"); assertEquals("nodelookupprefix17", "dmstc", prefix); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; Attr attr; String prefix; Attr attNode; doc = (Document) load("barfoo", false); elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "dom3:p"); attr = doc.createAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:lang"); attNode = elem.setAttributeNodeNS(attr); prefix = attr.lookupPrefix("http://www.w3.org/XML/1998/namespace"); assertNull("nodelookupprefix16", prefix); } /**
String attributeNSPrefix; if (attributeNSURI != null) { attributeNSPrefix = attribute.lookupPrefix(attributeNSURI); if (attributeNSPrefix == null && XMLConstants.XML_NS.equals(attributeNSURI)) { attributeNSPrefix = XMLConstants.XML_PREFIX;
String attributeNSPrefix; if (attributeNSURI != null) { attributeNSPrefix = attribute.lookupPrefix(attributeNSURI); if (attributeNSPrefix == null && XMLConstants.XML_NS.equals(attributeNSURI)) { attributeNSPrefix = XMLConstants.XML_PREFIX;
clonedNode = document.createAttribute(nodeName); } else { String prefix = ((Attr) sourceNode).lookupPrefix(namespaceURI);
String attributeNSPrefix; if (attributeNSURI != null) { attributeNSPrefix = attribute.lookupPrefix(attributeNSURI); if (attributeNSPrefix == null && XMLConstants.XML_NS.equals(attributeNSURI)) { attributeNSPrefix = XMLConstants.XML_PREFIX;
String attributeNSPrefix; if (attributeNSURI != null) { attributeNSPrefix = attribute.lookupPrefix(attributeNSURI); if (attributeNSPrefix == null && XMLConstants.XML_NS.equals(attributeNSURI)) { attributeNSPrefix = XMLConstants.XML_PREFIX;