com.itextpdf.text.xml
Class XMLUtil
java.lang.Object
com.itextpdf.text.xml.XMLUtil
public class XMLUtil
- extends Object
Contains utility methods for XML.
- Since:
- 5.0.6
- Author:
- Balder
Method Summary |
static String |
escapeXML(String s,
boolean onlyASCII)
Escapes a string with the appropriated XML codes. |
static String |
getEncodingName(byte[] b4)
Returns the IANA encoding name that is auto-detected from
the bytes specified, with the endian-ness of that encoding where appropriate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLUtil
public XMLUtil()
escapeXML
public static String escapeXML(String s,
boolean onlyASCII)
- Escapes a string with the appropriated XML codes.
- Parameters:
s
- the string to be escapedonlyASCII
- codes above 127 will always be escaped with &#nn; if true
- Returns:
- the escaped string
- Since:
- 5.0.6
getEncodingName
public static String getEncodingName(byte[] b4)
- Returns the IANA encoding name that is auto-detected from
the bytes specified, with the endian-ness of that encoding where appropriate.
(method found in org.apache.xerces.impl.XMLEntityManager, originally published
by the Apache Software Foundation under the Apache Software License; now being
used in iText under the MPL)
- Parameters:
b4
- The first four bytes of the input.
- Returns:
- an IANA-encoding string
- Since:
- 5.0.6
Copyright © 2011. All Rights Reserved.