org.apache.jasper.xmlparser

Class XMLEncodingDetector

Known Direct Subclasses:
XercesEncodingDetector

public class XMLEncodingDetector
extends java.lang.Object

Method Summary

static Object[]
getEncoding(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err)
Autodetects the encoding of the XML document supplied by the given input stream.
Object[]
getEncodingMethod(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err)

Method Details

getEncoding

public static Object[] getEncoding(String fname,
                                   JarFile jarFile,
                                   JspCompilationContext ctxt,
                                   ErrorDispatcher err)
            throws IOException,
                   JasperException
Autodetects the encoding of the XML document supplied by the given input stream. Encoding autodetection is done according to the XML 1.0 specification, Appendix F.1: Detection Without External Encoding Information.

Parameters:
err - The error dispatcher

Returns:
Two-element array, where the first element (of type java.lang.String) contains the name of the autodetected encoding, and the second element (of type java.lang.Boolean) specifies whether the encoding was specified by the encoding attribute of an XML declaration (prolog).


getEncodingMethod

public Object[] getEncodingMethod(String fname,
                                  JarFile jarFile,
                                  JspCompilationContext ctxt,
                                  ErrorDispatcher err)
            throws IOException,
                   JasperException


Copyright B) 2000 Apache Software Foundation. All Rights Reserved.