Static Public Member Functions | |
| static String | normalize (String s) |
| static String | normalizeXMLEmbeddedTextOnly (String xmlString) |
| static String | translate (char ch) |
Static Private Member Functions | |
| static String | normalize (String s, boolean normalizeXMLEmbeddedTextOnly) |
Normalizes XML data by escaping special characters such as '&' or ' <'.
| static String alma::acs::util::XmlNormalizer::normalize | ( | String | s | ) | [inline, static] |
Normalizes a string to not conflict with XML markup characters. Only allocates memory if the string s does contain such markup. Otherwise s is returned.
References normalize().
| static String alma::acs::util::XmlNormalizer::normalize | ( | String | s, | |
| boolean | normalizeXMLEmbeddedTextOnly | |||
| ) | [inline, static, private] |
Normalizes a string to not conflict with XML markup characters. Only allocates memory if the string s does contain such markup. Otherwise s is returned.
References translate().
Referenced by normalize(), and normalizeXMLEmbeddedTextOnly().
| static String alma::acs::util::XmlNormalizer::normalizeXMLEmbeddedTextOnly | ( | String | xmlString | ) | [inline, static] |
Normalizes any text in between quotes ("text") or text given as character data of mixed-content elements, all inside xmlString. Other text is left untouched. This method can be used to fix illegal text in an unparsable XML document, without destroying the XML markup itself.
Note that some rather simple parsing is used, and that there may be cases in which the result is undesirable. Thus this method should only be used as a fallback solution when the XML string can not be parsed with a regular XML parser.
| xmlString |
References normalize().
| static String alma::acs::util::XmlNormalizer::translate | ( | char | ch | ) | [inline, static] |
Translates the given character ch to its masked XML representation if this character is one of { <, >, &, ", ' }. Otherwise returns null.
| ch |
Referenced by normalize().
1.6.2