org.kxml
Class Xml

java.lang.Object
  extended by org.kxml.Xml

public class Xml
extends java.lang.Object

A class containing several static xml methods, mainly for escaping special characters like angle brakets and quotes. This class contains also some (partially shared) constants for the parser and kDOM.


Field Summary
static int COMMENT
          Integer constant for comments
static int DOCTYPE
          Integer constant for doctype
static int ELEMENT
          Integer constant for elements
static int ENCODE_128
          forces escaping of all character coded greater than 127
static int ENCODE_MIN
          minimum escaping, quotes are not escaped
static int ENCODE_QUOT
          forces escaping of quotes
static int END_DOCUMENT
          Integer constant returned by ParseEvent.getType if the end of the document has been reached
static int END_TAG
          Integer constant assigned to an EndTag parse event
static java.lang.String NO_NAMESPACE
           
static int PROCESSING_INSTRUCTION
          Integer constant assigned to a processing instruction
static int START_DOCUMENT
          XmlReader return value before the first call to next or skip
static int START_TAG
          Integer constant assigned to StartTag parse event
static int TEXT
          Integer constant assigned to text nodes and events
static int WAP_EXTENSION
          Constant identifying wap extension events
static int WHITESPACE
          Integer constant for whitespace nodes and events
 
Constructor Summary
Xml()
           
 
Method Summary
static java.lang.String encode(java.lang.String raw)
          convenience method for encode (String raw, ENCODE_MIN)
static java.lang.String encode(java.lang.String raw, int flags)
          encodes a string escaping less than etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_NAMESPACE

public static final java.lang.String NO_NAMESPACE
See Also:
Constant Field Values

START_DOCUMENT

public static final int START_DOCUMENT
XmlReader return value before the first call to next or skip

See Also:
Constant Field Values

COMMENT

public static final int COMMENT
Integer constant for comments

See Also:
Constant Field Values

DOCTYPE

public static final int DOCTYPE
Integer constant for doctype

See Also:
Constant Field Values

ELEMENT

public static final int ELEMENT
Integer constant for elements

See Also:
Constant Field Values

END_DOCUMENT

public static final int END_DOCUMENT
Integer constant returned by ParseEvent.getType if the end of the document has been reached

See Also:
Constant Field Values

END_TAG

public static final int END_TAG
Integer constant assigned to an EndTag parse event

See Also:
Constant Field Values

PROCESSING_INSTRUCTION

public static final int PROCESSING_INSTRUCTION
Integer constant assigned to a processing instruction

See Also:
Constant Field Values

START_TAG

public static final int START_TAG
Integer constant assigned to StartTag parse event

See Also:
Constant Field Values

TEXT

public static final int TEXT
Integer constant assigned to text nodes and events

See Also:
Constant Field Values

WHITESPACE

public static final int WHITESPACE
Integer constant for whitespace nodes and events

See Also:
Constant Field Values

ENCODE_MIN

public static final int ENCODE_MIN
minimum escaping, quotes are not escaped

See Also:
Constant Field Values

ENCODE_QUOT

public static final int ENCODE_QUOT
forces escaping of quotes

See Also:
Constant Field Values

ENCODE_128

public static int ENCODE_128
forces escaping of all character coded greater than 127


WAP_EXTENSION

public static final int WAP_EXTENSION
Constant identifying wap extension events

See Also:
Constant Field Values
Constructor Detail

Xml

public Xml()
Method Detail

encode

public static java.lang.String encode(java.lang.String raw)
convenience method for encode (String raw, ENCODE_MIN)


encode

public static java.lang.String encode(java.lang.String raw,
                                      int flags)
encodes a string escaping less than etc.