public class XMLUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MAP_KEY_URIS
This is the list of namespace URIs
|
static java.lang.String |
MAP_KEY_XMLNS
This is the xmlns value from the xml, may be null
|
| Constructor and Description |
|---|
XMLUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
findNameSpaces(java.lang.String xml)
Find any referenced namespaces(uri) in an xml.
|
static boolean |
isWhiteSpace(char b)
Checks if a char is a whitespace.
|
public static final java.lang.String MAP_KEY_XMLNS
public static final java.lang.String MAP_KEY_URIS
public static final java.util.Map<java.lang.String,java.lang.Object> findNameSpaces(java.lang.String xml)
The xml may not be well formed, may not even be xml.
Finds all instances of xmlns:xxx and xmlns=xxx.
All namespaces found are stored in a List<String>.
The List of found namespaces are stored in the returned map with the key constant XMLUtils.MAP_KEY_URIS.
The xmlns namespace is stored in the map with the key const XMLUtils.MAP_KEY_XMLNS.
xml - the xml that may contain the xmlns pattern- retrieve the list of namespace uris with this key,
- retrieve the xmlns= uri with this keypublic static boolean isWhiteSpace(char b)
whitespace = ' ' || 0x09 || 0x0a || 0x0d
b - - the char to check