List of utility methods to do XML Namespace
String | getPrefixFromNamespaceDeclaration(String namespace) Returns any prefix declared with this namespace. if (!namespace.startsWith(XMLConstants.XMLNS_ATTRIBUTE)) return null; int xmlnsLength = XMLConstants.XMLNS_ATTRIBUTE.length(); if (namespace.length() == xmlnsLength) { return ""; if (namespace.charAt(xmlnsLength) == ':') { return namespace.substring(xmlnsLength + 1); ... |
javax.xml.namespace.QName | getRequestMessageType(String intfNamespace, String op, String prefix) This method returns the request message type QName. javax.xml.namespace.QName ret = null; if (prefix != null) { ret = new javax.xml.namespace.QName(intfNamespace, op + REQUEST, prefix); } else { ret = new javax.xml.namespace.QName(intfNamespace, op + REQUEST); return (ret); |
String | getSchemaNamespace(Package pkg) get Schema Namespace XmlSchema xmlSchemaAnn = pkg.getAnnotation(XmlSchema.class); if (xmlSchemaAnn == null) { return null; return xmlSchemaAnn.namespace(); |
NamespaceContext | getTEINamespaceContext() Creates a NamespaceContext object with the following list of namespaces:
NamespaceContext ctx = new NamespaceContext() { public String getNamespaceURI(String prefix) { String uri; if (prefix.equals("tei")) uri = "http://www.tei-c.org/ns/1.0"; else uri = null; return uri; ... |
String | getXmlSchemaNamespace(Class> clazz) Gets the xml schema namespace. AnnotatedElement pack = clazz.getPackage(); if (pack == null) { return ""; XmlSchema schema = pack.getAnnotation(XmlSchema.class); String namespace = null; if (schema != null) { namespace = schema.namespace(); ... |
boolean | isNamespaceAware() is Namespace Aware return getDocumentBuilder().isNamespaceAware();
|
boolean | isValidFragment(final Object obj, final String namespace, final String localPart) is Valid Fragment return ((Node) obj).getNamespaceURI().equals(namespace) && ((Node) obj).getLocalName().equals(localPart);
|
void | logWriter(Logger logger, String msg, XMLStreamWriter writer, String namespaceURI) log Writer if (logger.isDebugEnabled()) {
logger.debug(writerStatus(msg, writer, namespaceURI));
|
void | printNamespace(XMLStreamReader xmlr, int index, StringBuffer result) print Namespace String prefix = xmlr.getNamespacePrefix(index); String uri = xmlr.getNamespaceURI(index); result.append(" "); if (prefix == null) result.append("xmlns='").append(uri).append("'"); else result.append("xmlns:").append(prefix).append("='").append(uri).append("'"); |
void | printNamespaces(XMLStreamReader xmlr) print Namespaces for (int i = 0; i < xmlr.getNamespaceCount(); i++) { printNamespace(xmlr, i); |