Package fr.becpg.repo.helper
Class XMLTextHelper
java.lang.Object
fr.becpg.repo.helper.XMLTextHelper
XMLTextHelper class.
- Version:
- $Id: $Id
- Author:
- matthieu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasInvalidChar(String in) Tells whether a text holds a character that may not appear in an XML 1.0 document and that the datasource writer therefore drops.private static intindexOfInvalidChar(String in, int from) static booleanisXmlChar(int codePoint) Tells whether a code point may appear in an XML 1.0 document.static StringwriteAttribute(String in) writeAttribute.static StringwriteCData(String in) writeCData.static StringwriteContent(String in) writeContent.
-
Constructor Details
-
XMLTextHelper
private XMLTextHelper()Constructor for XMLTextHelper.
-
-
Method Details
-
writeCData
writeCData.
-
isXmlChar
public static boolean isXmlChar(int codePoint) Tells whether a code point may appear in an XML 1.0 document. Control characters such as the optional and non breaking hyphens Word puts in copied text (U+001F, U+001E) may not, even escaped.- Parameters:
codePoint- the code point to test- Returns:
- true if the code point is allowed
-
hasInvalidChar
Tells whether a text holds a character that may not appear in an XML 1.0 document and that the datasource writer therefore drops.- Parameters:
in- the text to test, possibly null- Returns:
- true if at least one character is not allowed
-
indexOfInvalidChar
-
writeAttribute
writeAttribute.
-
writeContent
writeContent.
-