XmlUtil (fawkeZ - Developer's Documentation)

org.jcoderz.commons.util
Class XmlUtil

  extended by org.jcoderz.commons.util.XmlUtil

public final class XmlUtil
extends

This class holds utility methods for common xml topics.

Author:
Andreas Mandel

Field Summary
static  EMPTY_ATTRIBUTES
          Immutable and always empty version of a object.
 
Method Summary
static  attributeEscape( attribute)
          Encode a string so that it can be safely used as attribute value in XML output.
static  escape( text)
          Encode a string so that it can be safely used as text in an element for XML output.
static  formatXml( org)
          Simple xml formatter.
 
Methods inherited from class java.lang.
, , , , , , , , , ,
 

Field Detail

EMPTY_ATTRIBUTES

public static final  EMPTY_ATTRIBUTES
Immutable and always empty version of a object.

Method Detail

attributeEscape

public static  attributeEscape( attribute)
Encode a string so that it can be safely used as attribute value in XML output.

Parameters:
attribute - the attribute value to be encoded.
Returns:
a string representing the attribute value that can be safely used in XML output.

escape

public static  escape( text)
Encode a string so that it can be safely used as text in an element for XML output.

Parameters:
text - the element text body.
Returns:
a string so that it can be safely used as text in an element for XML output.

formatXml

public static  formatXml( org)
Simple xml formatter. This code might fail for several input. In this case the original input is returned.

Parameters:
org - the input to be formated.
Returns:
the input in xml formated (human readable) form or the input string.


Copyright 2007 The jCoderZ Project.