String localName = document.getDocumentElement().getLocalName(); log.debug(localName); if (document.getDocumentElement().isDefaultNamespace("http://schemas.microsoft.com/?office/?2006/?coverPageProps") || localName.equals("CoverPageProperties" ) ) {
@Override public boolean isDefaultNamespace(String namespaceURI) { return element.isDefaultNamespace(namespaceURI); }
@Override public boolean isDefaultNamespace(String namespaceURI) { return element.isDefaultNamespace(namespaceURI); }
/** * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) */ public boolean isDefaultNamespace(String namespaceURI) { return getCurrentInternal().isDefaultNamespace(namespaceURI); }
public static String getPrefix(Element element, String namespace) { if (element.isDefaultNamespace(namespace)) { return XMLConstants.DEFAULT_NS_PREFIX; } return element.lookupPrefix(namespace); }
public static String getPrefix(Element element, String namespace) { if (element.isDefaultNamespace(namespace)) { return XMLConstants.DEFAULT_NS_PREFIX; } return element.lookupPrefix(namespace); }
/** * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) */ public boolean isDefaultNamespace(String namespaceURI) { return getAtualInterno().isDefaultNamespace(namespaceURI); }
/** * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) */ @Override public boolean isDefaultNamespace(String namespaceURI) { return original.get().isDefaultNamespace(namespaceURI); }
@Override public boolean isDefaultNamespace(String namespaceURI) { Element e = getDocumentElement(); return e != null ? e.isDefaultNamespace(namespaceURI) : false; }
/** * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) */ @Override public boolean isDefaultNamespace(String namespaceURI) { return original.get().isDefaultNamespace(namespaceURI); }
@Override public boolean isDefaultNamespace(String namespaceURI) { final Element elem = getElement(); return elem != null ? elem.isDefaultNamespace(namespaceURI) : Boolean.FALSE; }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; NodeList elemList; boolean isDefault; doc = (Document) load("hc_staff", false); elemList = doc.getElementsByTagName("p"); elem = (Element) elemList.item(0); isDefault = elem.isDefaultNamespace("http://www.w3.org/1999/xhtml"); assertTrue("nodeisdefaultnamespace06_1", isDefault); isDefault = elem.isDefaultNamespace("http://www.usa.com"); assertFalse("nodeisdefaultnamespace06_2", isDefault); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; NodeList elemList; boolean isDefault; doc = (Document) load("hc_staff", false); elemList = doc.getElementsByTagName("acronym"); elem = (Element) elemList.item(0); isDefault = elem.isDefaultNamespace("http://www.w3.org/1999/xhtml"); assertTrue("nodeisdefaultnamespace07_1", isDefault); isDefault = elem.isDefaultNamespace("http://www.usa.com"); assertFalse("nodeisdefaultnamespace07_2", isDefault); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; NodeList elemList; boolean isDefault; doc = (Document) load("hc_staff", false); elemList = doc.getElementsByTagName("strong"); elem = (Element) elemList.item(3); isDefault = elem.isDefaultNamespace("http://www.altavista.com"); assertFalse("nodeisdefaultnamespace08", isDefault); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element parent; Element child; boolean isDefault; Node appendedChild; doc = (Document) load("hc_staff", false); parent = doc.createElementNS("http://www.w3.org/1999/xhtml", "xhtml:body"); child = doc.createElement("xhtml:p"); appendedChild = parent.appendChild(child); isDefault = parent.isDefaultNamespace("http://www.w3.org/1999/xhtml"); assertFalse("nodeisdefaultnamespace09_1", isDefault); isDefault = child.isDefaultNamespace("http://www.w3.org/1999/xhtml"); assertFalse("nodeisdefaultnamespace09_2", isDefault); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element parent; Element child; boolean isDefault; Node appendedChild; doc = (Document) load("hc_staff", false); parent = doc.createElementNS("http://www.w3.org/1999/xhtml", "xhtml:body"); child = doc.createElementNS("http://www.w3.org/1999/xhtml", "p"); appendedChild = parent.appendChild(child); isDefault = child.isDefaultNamespace("http://www.w3.org/1999/xhtml"); assertTrue("nodeisdefaultnamespace10_1", isDefault); isDefault = parent.isDefaultNamespace("http://www.w3.org/1999/xhtml"); assertFalse("nodeisdefaultnamespace10_2", isDefault); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; Element elem; DOMImplementation domImpl; Document newDoc; boolean isDefault; DocumentType nullDocType = null; String nullNSURI = null; Element docElem; String rootNS; String rootName; doc = (Document) load("hc_staff", false); docElem = doc.getDocumentElement(); rootNS = docElem.getNamespaceURI(); rootName = docElem.getLocalName(); domImpl = doc.getImplementation(); newDoc = domImpl.createDocument(rootNS, rootName, nullDocType); elem = newDoc.getDocumentElement(); isDefault = elem.isDefaultNamespace(rootNS); assertTrue("nodeisdefaultnamespace05_1", isDefault); isDefault = elem.isDefaultNamespace(nullNSURI); assertFalse("nodeisdefaultnamespace05_2", isDefault); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; DOMImplementation domImpl; Document newDoc; Element elem; Element importedNode; boolean isDefault; DocumentType nullDocType = null; Element docElem; String rootNS; String rootName; doc = (Document) load("hc_staff", false); docElem = doc.getDocumentElement(); rootNS = docElem.getNamespaceURI(); rootName = docElem.getTagName(); domImpl = doc.getImplementation(); newDoc = domImpl.createDocument(rootNS, rootName, nullDocType); elem = doc.createElementNS("http://www.w3.org/1999/xhtml", "p"); importedNode = (Element) newDoc.importNode(elem, true); isDefault = importedNode.isDefaultNamespace("http://www.w3.org/1999/xhtml"); assertTrue("nodeisdefaultnamespace11", isDefault); } /**
public void handleChunkEnd(final List<QName> currentXPath, final QName handlerQName, final String xmlChunk) { Element request = DOMParser.createNew().parse(new InputSource(new StringReader(xmlChunk))).getDocumentElement(); if (LOG.isDebugEnabled()) { debugPDPRequest(request); } Element response = getDecisionService().evaluate(request); if (request.isDefaultNamespace(PDP_REQUEST_NAME_V2.getNamespaceURI())) { response.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, PDP_REQUEST_NAME_V2.getNamespaceURI()); } if (LOG.isDebugEnabled()) { debugPDPResponse(response); } DOMSerializer.createNew(DOMSerializerOptions.getDefaultOptions().omitXMLDeclaration().encodingUTF8()) .serialize(response, out); }
if (qn.local().equals(element.getLocalName()) && element.isDefaultNamespace(element.getNamespaceURI())) { qn.set_namespace(element.getNamespaceURI());