org.w3c.dom.Element.isDefaultNamespace()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.w3c.dom.Element.isDefaultNamespace()方法的一些代码示例,展示了Element.isDefaultNamespace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.isDefaultNamespace()方法的具体详情如下:
包路径:org.w3c.dom.Element
类名称:Element
方法名:isDefaultNamespace

Element.isDefaultNamespace介绍

暂无

代码示例

代码示例来源:origin: plutext/docx4j

String localName = document.getDocumentElement().getLocalName();
log.debug(localName);
if (document.getDocumentElement().isDefaultNamespace("http://schemas.microsoft.com/?office/?2006/?coverPageProps")
    || localName.equals("CoverPageProperties" ) ) {

代码示例来源:origin: xyz.cofe/common

@Override
public boolean isDefaultNamespace(String namespaceURI) {
  return element.isDefaultNamespace(namespaceURI);
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public boolean isDefaultNamespace(String namespaceURI) {
  return element.isDefaultNamespace(namespaceURI);
}

代码示例来源:origin: org.opensingular/singular-commons

/**
 * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String)
 */
public boolean isDefaultNamespace(String namespaceURI) {
  return getCurrentInternal().isDefaultNamespace(namespaceURI);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public static String getPrefix(Element element, String namespace) {
  if (element.isDefaultNamespace(namespace)) {
    return XMLConstants.DEFAULT_NS_PREFIX;
  }
  return element.lookupPrefix(namespace);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-common-xml

public static String getPrefix(Element element, String namespace) {
  if (element.isDefaultNamespace(namespace)) {
    return XMLConstants.DEFAULT_NS_PREFIX;
  }
  return element.lookupPrefix(namespace);
}

代码示例来源:origin: org.opensingular/form-core

/**
 * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String)
 */
public boolean isDefaultNamespace(String namespaceURI) {
  return getAtualInterno().isDefaultNamespace(namespaceURI);
}

代码示例来源:origin: org.opensingular/singular-commons

/**
 * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String)
 */
@Override
public boolean isDefaultNamespace(String namespaceURI) {
  return original.get().isDefaultNamespace(namespaceURI);
}

代码示例来源:origin: com.marklogic/marklogic-mapreduce2

@Override
public boolean isDefaultNamespace(String namespaceURI) {
  Element e = getDocumentElement();
  return e != null ? e.isDefaultNamespace(namespaceURI) : false;
}

代码示例来源:origin: org.opensingular/form-core

/**
 * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String)
 */
@Override
public boolean isDefaultNamespace(String namespaceURI) {
  return original.get().isDefaultNamespace(namespaceURI);
}

代码示例来源:origin: Geomatys/geotoolkit

@Override
public boolean isDefaultNamespace(String namespaceURI) {
  final Element elem = getElement();
  return elem != null ? elem.isDefaultNamespace(namespaceURI) : Boolean.FALSE;
}

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

/**
  * 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);
}
  /**

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

/**
  * 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);
}
  /**

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

/**
  * 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);
}
  /**

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

/**
  * 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);
}
  /**

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

/**
  * 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);
}
  /**

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

/**
  * 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);
}
  /**

代码示例来源:origin: org.apache.ws.commons.axiom/dom-testsuite

/**
* 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);
 }
/**

代码示例来源:origin: org.n52.security/52n-security-decision-xacml

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);
}

代码示例来源:origin: com.rackspace.eclipse.webtools.sourceediting/org.eclipse.wst.xml.xpath2.processor

if (qn.local().equals(element.getLocalName()) && element.isDefaultNamespace(element.getNamespaceURI())) {
  qn.set_namespace(element.getNamespaceURI());

相关文章

微信公众号

最新文章

更多