Class XMLDeclarationParser

java.lang.Object
org.exoplatform.commons.xml.XMLDeclarationParser

public class XMLDeclarationParser extends Object
Parses XML 1.0 and XML 1.1 declarations. This class can be used in a situation where the actual encoding of an XML document is known but the encoding stated in the XML declaration of the given XML file needs to be determined, e.g. if it is necessary to find out if the declared encoding is the same as the actual encoding. Usage Example: new XMLDeclarationParser("<?xml version=\"1.0\" encoding=\"UTF-8\"?>").parse().get(XMLDeclarationParser.ENCODING) returns "UTF-8"
Author:
ppalaga@redhat.com