/** * @inheritDoc */ public String getNamespaceURI() { return dom.getNamespaceURI(); }
public String getNamespaceURI() { return document.getNamespaceURI(); }
public String getNamespaceURI() { return document.getNamespaceURI(); }
@Override public String getNamespaceURI() { return document.getNamespaceURI(); }
public String getNamespaceURI() { return this.doc.getNamespaceURI(); }
@Override public String getNamespaceURI() { return original_.getNamespaceURI(); }
@Override public String getNamespaceURI() { return original_.getNamespaceURI(); }
public String getNamespaceURI() { return document.getNamespaceURI(); }
/** * The namespace URI of this node, or <code>null</code> if it is unspecified. <br>This is not a * computed value that is the result of a namespace lookup based on an examination of the * namespace declarations in scope. It is merely the namespace URI given at creation time. * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 method, such as * <code>createElement</code> from the <code>Document</code> interface, this is always * <code>null</code>.Per the Namespaces in XML Specification an attribute does not inherit its * namespace from the element it is attached to. If an attribute is not explicitly given a * namespace, it simply has no namespace. * * @since DOM Level 2 */ public String getNamespaceURI() { return document.getNamespaceURI(); }
/** * The namespace URI of this node, or <code>null</code> if it is unspecified. <br>This is not a * computed value that is the result of a namespace lookup based on an examination of the * namespace declarations in scope. It is merely the namespace URI given at creation time. * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 method, such as * <code>createElement</code> from the <code>Document</code> interface, this is always * <code>null</code>.Per the Namespaces in XML Specification an attribute does not inherit its * namespace from the element it is attached to. If an attribute is not explicitly given a * namespace, it simply has no namespace. * * @since DOM Level 2 */ public String getNamespaceURI() { return document.getNamespaceURI(); }
/** * @param document * document representing <code>WEB-INF/faces-config.xml</code> * @return return the value of the version attribute of the provided document. If no version attribute is specified, * assume 1.1. */ private double getVersion(Document document) { String version = document.getDocumentElement().getAttributeNS(document.getNamespaceURI(), "version"); if (version != null && version.length() > 0) { return Double.parseDouble(version); } return 1.1d; }
/** * @param document * document representing <code>WEB-INF/faces-config.xml</code> * @return return the value of the version attribute of the provided document. If no version attribute is specified, * assume 1.1. */ private double getVersion(Document document) { String version = document.getDocumentElement().getAttributeNS(document.getNamespaceURI(), "version"); if (version != null && version.length() > 0) { return Double.parseDouble(version); } return 1.1d; }
/** * @param document document representing <code>WEB-INF/faces-config.xml</code> * @return return the value of the version attribute of the provided document. * If no version attribute is specified, assume 1.1. */ private double getVersion(Document document) { String version = document.getDocumentElement() .getAttributeNS(document.getNamespaceURI(), "version"); if (version != null && version.length() > 0) { return Double.parseDouble(version); } else { return 1.1d; } }
/** * @param document * document representing <code>WEB-INF/faces-config.xml</code> * @return return the value of the version attribute of the provided document. If no version attribute is specified, * assume 1.1. */ private double getVersion(Document document) { String version = document.getDocumentElement().getAttributeNS(document.getNamespaceURI(), "version"); if (version != null && version.length() > 0) { return Double.parseDouble(version); } return 1.1d; }
private boolean isMetadataComplete(Document document) { if (isVersionGreaterOrEqual(2.0)) { String metadataComplete = document.getDocumentElement().getAttributeNS(document.getNamespaceURI(), "metadata-complete"); return metadataComplete != null ? Boolean.valueOf(metadataComplete) : false; } // not a 2.0 application, so annotation processing will not occur return true; }
private boolean isMetadataComplete(Document document) { if (isVersionGreaterOrEqual(2.0)) { String metadataComplete = document.getDocumentElement().getAttributeNS(document.getNamespaceURI(), "metadata-complete"); return metadataComplete != null ? Boolean.valueOf(metadataComplete) : false; } // not a 2.0 application, so annotation processing will not occur return true; }
private boolean isMetadataComplete(Document document) { if (isVersionGreaterOrEqual(2.0)) { String metadataComplete = document.getDocumentElement() .getAttributeNS(document.getNamespaceURI(), "metadata-complete"); return ((metadataComplete != null) ? Boolean.valueOf(metadataComplete) : false); } else { // not a 2.0 application, so annotation processing will not occur return true; } }
public static XmlMapping recognize(InputStream is) throws IOException, SAXException, ParserConfigurationException { DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Document doc = docBuilder.parse(is); String namespaceURI = doc.getNamespaceURI(); String name = doc.getDocumentElement().getNodeName(); return recognize(namespaceURI, name); }
private boolean isMetadataComplete(Document document) { if (isVersionGreaterOrEqual(2.0)) { String metadataComplete = document.getDocumentElement().getAttributeNS(document.getNamespaceURI(), "metadata-complete"); return metadataComplete != null ? Boolean.valueOf(metadataComplete) : false; } // not a 2.0 application, so annotation processing will not occur return true; }
/** * Gets the XML document. * * @param is the input stream * @param request the request * @return the XML document * @throws Exception the exception */ protected Document getXmlDocument(InputStream is, Request request) throws Exception { is = preProcessHtml(request, is); is = applyXsltTransformation(request, is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments(true); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); StringWriter writer = new StringWriter(); IOUtils.copy(is, writer, StandardCharsets.UTF_8); String contents = writer.toString(); Document doc = builder.parse(IOUtils.toInputStream(contents, StandardCharsets.UTF_8)); // Ugly hack to deal with DOM & XPath 1.0's battle royale // over handling namespaces without a prefix. if(doc.getNamespaceURI() != null && doc.getPrefix() == null){ factory.setNamespaceAware(false); builder = factory.newDocumentBuilder(); doc = builder.parse(IOUtils.toInputStream(contents, StandardCharsets.UTF_8)); } return doc; }