public class XmlCompression
extends java.lang.Object
Compress an XML document by substituting element and attribute names with _N (where N >= 0), and substituting attribute values with $N. Such compression introduces a compression dictionary at the start of the document containing the substitution names and values. A compressed document can often be parsed more efficiently than the original document (e.g. 3 times faster). Two XML processing instructions are added to the document to indicate the compression dictionary, e.g.
where base is 10 to 36 (if base is omitted, it defaults to 36).Modifier and Type | Class and Description |
---|---|
static class |
XmlCompression.Options
XML compress options.
|
Constructor and Description |
---|
XmlCompression() |
Modifier and Type | Method and Description |
---|---|
static void |
compress(XmlDocument document)
|
static void |
compress(XmlDocument document,
XmlCompression.Options options)
Compress an XML document in-place.
|
public static void compress(XmlDocument document)
document
- Document parameter.public static void compress(XmlDocument document, XmlCompression.Options options)
Compress an XML document in-place.
document
- XML document to be compressed.options
- Compression options.