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

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

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

Element.getBaseURI介绍

暂无

代码示例

代码示例来源:origin: apache/batik

  1. /**
  2. * Returns the base URI of the referer element.
  3. */
  4. protected String getRefererBaseURI(Element ref) {
  5. return ref.getBaseURI();
  6. }

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

  1. @Override
  2. public String getBaseURI() {
  3. return element.getBaseURI();
  4. }

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

  1. @Override
  2. public String getBaseURI() {
  3. return element.getBaseURI();
  4. }

代码示例来源:origin: apache/cxf

  1. private void updateJaxwsBindingMapValue(Element value) {
  2. String baseURI = value.getBaseURI();
  3. for (Map.Entry<Element, Element> entry : jaxwsBindingsMap.entrySet()) {
  4. String uri = entry.getValue().getBaseURI();
  5. if (uri != null && uri.equals(baseURI)) {
  6. jaxwsBindingsMap.put(entry.getKey(), value);
  7. }
  8. }
  9. }

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

  1. /**
  2. * @see org.w3c.dom.Node#getBaseURI()
  3. */
  4. public String getBaseURI() {
  5. return getAtualInterno().getBaseURI();
  6. }

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

  1. /**
  2. * @see org.w3c.dom.Node#getBaseURI()
  3. */
  4. public String getBaseURI() {
  5. return getCurrentInternal().getBaseURI();
  6. }

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

  1. @Override
  2. public String getBaseURI() {
  3. final Element elem = getElement();
  4. return elem != null ? elem.getBaseURI() : null;
  5. }

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

  1. /**
  2. * @see org.w3c.dom.Node#getBaseURI()
  3. */
  4. @Override
  5. public String getBaseURI() {
  6. return original.get().getBaseURI();
  7. }

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

  1. /**
  2. * @see org.w3c.dom.Node#getBaseURI()
  3. */
  4. @Override
  5. public String getBaseURI() {
  6. return original.get().getBaseURI();
  7. }

代码示例来源:origin: org.daisy.pipeline/common-utils

  1. public static void writeStartElement(XMLStreamWriter writer, Element element,
  2. boolean copyAttributes, boolean copyNamespaceNodes, boolean copyBaseURI)
  3. throws XMLStreamException {
  4. String prefix = element.getPrefix();
  5. String ns = element.getNamespaceURI();
  6. String localPart = element.getLocalName();
  7. if (prefix != null)
  8. writer.writeStartElement(prefix, localPart, ns);
  9. else if (ns != null)
  10. writer.writeStartElement(ns, localPart);
  11. else
  12. writer.writeStartElement(localPart);
  13. if (copyAttributes) {
  14. writeAttributes(writer, element, copyNamespaceNodes);
  15. }
  16. if (copyBaseURI) {
  17. if (writer instanceof BaseURIAwareXMLStreamWriter) {
  18. String baseURI = element.getBaseURI();
  19. ((BaseURIAwareXMLStreamWriter)writer).setBaseURI(baseURI == null ? null : URI.create(baseURI));
  20. } else
  21. throw new IllegalArgumentException();
  22. }
  23. }

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

  1. /**
  2. * Runs the test case.
  3. * @throws Throwable Any uncaught exception causes test to fail
  4. */
  5. public void runTest() throws Throwable {
  6. Document doc;
  7. Element bodyElem;
  8. NodeList bodyList;
  9. String baseURI;
  10. doc = (Document) load("barfoo_base", false);
  11. bodyList = doc.getElementsByTagName("body");
  12. bodyElem = (Element) bodyList.item(0);
  13. baseURI = bodyElem.getBaseURI();
  14. assertEquals("nodegetbaseuri09", "http://www.w3.org/DOM/EmployeeID", baseURI);
  15. }
  16. /**

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

  1. /**
  2. * Runs the test case.
  3. * @throws Throwable Any uncaught exception causes test to fail
  4. */
  5. public void runTest() throws Throwable {
  6. Document doc;
  7. Element docElem;
  8. String baseURI;
  9. doc = (Document) load("barfoo_base", false);
  10. docElem = doc.getDocumentElement();
  11. baseURI = docElem.getBaseURI();
  12. assertEquals("nodegetbaseuri05", "http://www.w3.org/DOM/L3Test", baseURI);
  13. }
  14. /**

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

  1. /**
  2. * Runs the test case.
  3. * @throws Throwable Any uncaught exception causes test to fail
  4. */
  5. public void runTest() throws Throwable {
  6. Document doc;
  7. Element newElement;
  8. String baseURI;
  9. Node appended;
  10. NodeList bodyList;
  11. Element bodyElem;
  12. String htmlNS = "http://www.w3.org/1999/xhtml";
  13. doc = (Document) load("barfoo_base", true);
  14. bodyList = doc.getElementsByTagName("body");
  15. bodyElem = (Element) bodyList.item(0);
  16. newElement = doc.createElementNS(htmlNS, "meta");
  17. newElement.setAttribute("content", "text/xml");
  18. appended = bodyElem.appendChild(newElement);
  19. baseURI = newElement.getBaseURI();
  20. assertEquals("nodegetbaseuri07", "http://www.w3.org/DOM/EmployeeID", baseURI);
  21. }
  22. /**

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

  1. /**
  2. * Runs the test case.
  3. * @throws Throwable Any uncaught exception causes test to fail
  4. */
  5. public void runTest() throws Throwable {
  6. Document doc;
  7. String baseURI;
  8. NodeList pList;
  9. Element pElem;
  10. doc = (Document) load("external_barfoo", true);
  11. pList = doc.getElementsByTagName("p");
  12. pElem = (Element) pList.item(2);
  13. assertNotNull("pElemNotNull", pElem);
  14. baseURI = pElem.getBaseURI();
  15. assertURIEquals("equalsExternalBarFoo", null, null, null, null, "external_widget", null, null, Boolean.TRUE, baseURI);
  16. }
  17. /**

代码示例来源:origin: metafacture/metafacture-core

  1. @SuppressWarnings("rawtypes")
  2. private StreamPipe getTransformation() throws InitializationError {
  3. final NodeList nodes = config.getElementsByTagName(TRANSFORMATION_TAG);
  4. if (nodes.getLength() == 0) {
  5. return null;
  6. }
  7. final Element transformationElement = (Element) nodes.item(0);
  8. final String type = transformationElement.getAttribute(TYPE_ATTR);
  9. final String src = transformationElement.getAttribute(SRC_ATTR);
  10. if (MIME_METAMORPH.equals(type)) {
  11. if (src.isEmpty()) {
  12. final InputSource transformationSource =
  13. new InputSource(getDataEmbedded(transformationElement));
  14. transformationSource.setSystemId(transformationElement.getBaseURI());
  15. return new Metamorph(transformationSource);
  16. }
  17. return new Metamorph(src);
  18. } else if (MIME_JAVACLASS.equals(type)) {
  19. if (src.isEmpty()) {
  20. throw new InitializationError(
  21. "class defining transformation not specified");
  22. }
  23. return ReflectionUtil.loadClass(src, StreamPipe.class).newInstance();
  24. }
  25. throw new InitializationError("transformation of type " + type +
  26. " is not supperted");
  27. }

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

  1. /**
  2. * Runs the test case.
  3. * @throws Throwable Any uncaught exception causes test to fail
  4. */
  5. public void runTest() throws Throwable {
  6. Document doc;
  7. Element docElem;
  8. String baseURI;
  9. String documentURI;
  10. doc = (Document) load("barfoo", false);
  11. docElem = doc.getDocumentElement();
  12. baseURI = docElem.getBaseURI();
  13. assertURIEquals("baseURI", null, null, null, null, "barfoo", null, null, Boolean.TRUE, baseURI);
  14. documentURI = doc.getDocumentURI();
  15. assertEquals("baseURIEqualsDocURI", documentURI, baseURI);
  16. }
  17. /**

代码示例来源:origin: apache/batik

  1. String baseURI = paintElement.getBaseURI();
  2. ParsedURL purl = new ParsedURL(baseURI, uri);

代码示例来源:origin: apache/batik

  1. return "";
  2. String baseURI = e.getBaseURI();
  3. ParsedURL purl = new ParsedURL(baseURI, uriStr);

代码示例来源:origin: apache/cxf

  1. String baseURI = null;
  2. try {
  3. baseURI = el.getBaseURI();
  4. } catch (Exception ex) {

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

  1. String baseURI = null;
  2. try {
  3. baseURI = el.getBaseURI();
  4. } catch (Exception ex) {

相关文章