Class XMLWriter


  • public class XMLWriter
    extends Object
    This class can be used for retrieving xml used in xsl transformations. XML is retrieved from the request and session context.
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLWriter()
      Constructs a new instance for retrieving xml from the request and session.
    • Constructor Detail

      • XMLWriter

        public XMLWriter()
        Constructs a new instance for retrieving xml from the request and session.
    • Method Detail

      • getXml

        public void getXml​(javax.servlet.http.HttpServletRequest request,
                           String keyPrefix,
                           Writer writer)
                    throws IOException
        Retrieves the xml from the request context and the session for keys starting with a prefix.
        Parameters:
        req - The request from with the xml should be retrieved, possible null.
        keyPrefix - The prefix the keys that should be retrieved.
        writer - The writer to which the result should be written.
        Throws:
        IOException - If the result could not be written to the writer.
      • getXml

        public void getXml​(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpSession session,
                           String keyPrefix,
                           Writer writer)
                    throws IOException
        Retrieves the xml from the request context and the session for keys starting with a prefix.
        Parameters:
        req - The request from with the xml should be retrieved, possible null.
        session - The session from which the xml should be retrieved, possible null.
        keyPrefix - The prefix for the keys that should be retrieved.
        writer - The writer to which the result should be written.
        Throws:
        IOException - If the result could not be written to the writer.
      • normalizeXml

        protected void normalizeXml​(String xml,
                                    Writer writer)
                             throws IOException
        Normalizes xml and writers it to a writer.
        Parameters:
        xml - The xml that should be normalized.
        writer - The output stream for the result.
        Throws:
        IOException - If the result could not be written to the writer.