org.exolab.adaptx.xpath.engine
Class XMLUtils
java.lang.Object
org.exolab.adaptx.xpath.engine.XMLUtils
public final class XMLUtils
extends java.lang.Object
A utility class for handling whitespace and namespaces.
The code in this class was adapted from XSL:P.
Version:
- Keith Visco
static char | CR - Carriage Return character
|
static String | EMPTY - Empty String
|
static char | LF - Linefeed character
|
static char | NULL - Null character
|
static char | SPACE - Single space character
|
static char | TAB - Tab character
|
static String[] | fromQualified(String qname)
|
static String | stripSpace(String data) - Strips whitespace from the given String.
|
static String | stripSpace(String data, boolean stripAllLeadSpace, boolean stripAllTrailSpace) - Strips whitespace from the given String.
|
static int | stripSpace(char[] data, boolean stripAllLeadSpace, boolean stripAllTrailSpace) - Strips whitespace from the given String.
|
static String | toQualified(String uri, String local)
|
CR
public static final char CR
Carriage Return character
EMPTY
public static final String EMPTY
Empty String
LF
public static final char LF
Linefeed character
NULL
public static final char NULL
Null character
SPACE
public static final char SPACE
Single space character
TAB
public static final char TAB
Tab character
fromQualified
public static String[] fromQualified(String qname)
stripSpace
public static String stripSpace(String data)
Strips whitespace from the given String. Newlines (#xD),
tabs (#x9), and consecutive spaces (#x20) are converted to
a single space (#x20). This method is useful for processing
consective Strings since any leading spaces will be converted
to a single space.
data
- the String to strip whitespace from
stripSpace
public static String stripSpace(String data,
boolean stripAllLeadSpace,
boolean stripAllTrailSpace)
Strips whitespace from the given String. Newlines (#xD),
tabs (#x9), and consecutive spaces (#x20) are converted to
a single space (#x20).
data
- the String to strip whitespace from
stripSpace
public static int stripSpace(char[] data,
boolean stripAllLeadSpace,
boolean stripAllTrailSpace)
Strips whitespace from the given String. Newlines (#xD),
tabs (#x9), and consecutive spaces (#x20) are converted to
a single space (#x20).
data
- the chars to strip whitespace from
- the new length of the array
toQualified
public static String toQualified(String uri,
String local)