org.mmbase.util.transformers
Class Xml
java.lang.Object
org.mmbase.util.transformers.StringTransformer
org.mmbase.util.transformers.ConfigurableStringTransformer
org.mmbase.util.transformers.Xml
- All Implemented Interfaces:
- CharTransformer, ConfigurableTransformer, Serializable, Transformer
- public class Xml
- extends ConfigurableStringTransformer
- implements CharTransformer
Transformations related to escaping in XML.
- Version:
- $Id: Xml.java,v 1.17 2005/12/21 08:05:01 michiel Exp $
- Author:
- Michiel Meeuwissen, Kees Jongenburger
- See Also:
- Serialized Form
|
Constructor Summary |
Xml()
|
Xml(int c)
|
ESCAPE
public static final int ESCAPE
- See Also:
- Constant Field Values
ESCAPE_ATTRIBUTE
public static final int ESCAPE_ATTRIBUTE
- See Also:
- Constant Field Values
ESCAPE_ATTRIBUTE_DOUBLE
public static final int ESCAPE_ATTRIBUTE_DOUBLE
- See Also:
- Constant Field Values
ESCAPE_ATTRIBUTE_SINGLE
public static final int ESCAPE_ATTRIBUTE_SINGLE
- See Also:
- Constant Field Values
ESCAPE_ATTRIBUTE_HTML
public static final int ESCAPE_ATTRIBUTE_HTML
- See Also:
- Constant Field Values
Xml
public Xml()
Xml
public Xml(int c)
transformers
public Map transformers()
- Used when registering this class as a possible Transformer
- Specified by:
transformers in interface ConfigurableTransformer- Specified by:
transformers in class ConfigurableStringTransformer
XMLAttributeEscape
public static String XMLAttributeEscape(String att,
char quot)
- Attributes of XML tags cannot contain quotes, and also & must be escaped
- Parameters:
att - String representing the attributequot - Which quote (either ' or ")
XMLAttributeEscape
public static String XMLAttributeEscape(String att)
- Attributes of XML tags cannot contain quotes, and also & must be escaped
- Parameters:
att - String representing the attribute
XMLEscape
public static String XMLEscape(String xml)
- Utility class for escaping and unescaping
(XML)data
- Parameters:
xml - the xml to encode
- Returns:
- the encoded xml data
- & is replaced by &
- " is replaced by "
- < is replaced by <
- > is replaced by >
XMLEscape
public static void XMLEscape(String xml,
StringBuffer sb)
- Since:
- MMBase-1.8
XMLUnescape
public static String XMLUnescape(String data)
- Utility class for escaping and unescaping
(XML)data
- Parameters:
data - the data to decode to (html/xml) where
- & was replaced by &
- " was replaced by "
- < was replaced by <
- > was replaced by >
- Returns:
- the decoded xml data
transform
public String transform(String r)
- Specified by:
transform in interface CharTransformer- Specified by:
transform in class StringTransformer
transformBack
public String transformBack(String r)
- Specified by:
transformBack in interface CharTransformer- Overrides:
transformBack in class StringTransformer
getEncoding
public String getEncoding()
- Description copied from interface:
ConfigurableTransformer
- Returns the encoding that is currently active
- Specified by:
getEncoding in interface ConfigurableTransformer- Specified by:
getEncoding in class ConfigurableStringTransformer
MMBase build 1.8.1.20060716