Package org.apache.xml.serializer

Examples of org.apache.xml.serializer.ToXMLSAXHandler


     * Return a SerializationHandler for output handling.
     * This method is used by Result Tree Fragments.
     */
    public SerializationHandler getOutputDomBuilder()
    {
        return new ToXMLSAXHandler(this, "UTF-8");
    }
View Full Code Here


       
        if (nextSibling != null)
          handler.setNextSibling(nextSibling);
       
          String encoding = format.getProperty(OutputKeys.ENCODING);         
          xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding);
      }
      else if (outputTarget instanceof SAXResult)
      {
        ContentHandler handler = ((SAXResult) outputTarget).getHandler();
       
        if (null == handler)
           throw new IllegalArgumentException(
             "handler can not be null for a SAXResult");
            
        LexicalHandler lexHandler;
        if (handler instanceof LexicalHandler)    
            lexHandler = (LexicalHandlerhandler;
        else
            lexHandler = null;
           
        String encoding = format.getProperty(OutputKeys.ENCODING);
        String method = format.getProperty(OutputKeys.METHOD);

        ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding);
        toXMLSAXHandler.setShouldOutputNSAttr(false);
        xoh = toXMLSAXHandler;  


        String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC);
        String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM);
View Full Code Here

    {
      m_outputContentHandler = handler;

      if (null == m_serializationHandler)
      {
        ToXMLSAXHandler h = new ToXMLSAXHandler();
        h.setContentHandler(handler);
        h.setTransformer(this);
       
        m_serializationHandler = h;
      }
      else
        m_serializationHandler.setContentHandler(handler);
View Full Code Here

    // Save the current result tree handler.
    SerializationHandler savedRTreeHandler = this.m_serializationHandler;

    // And make a new handler for the RTF.
    ToSAXHandler h = new ToXMLSAXHandler();
    h.setContentHandler(rtfHandler);
    h.setTransformer(this);
   
    // Replace the old handler (which was already saved)
    m_serializationHandler = h;
    // use local variable for the current handler
View Full Code Here

         // %REVIEW% Make sure current node is being pushed.
         LexicalHandler lex = null;
         if (handler instanceof LexicalHandler) {
            lex = (LexicalHandler) handler;
         }
         m_serializationHandler = new ToXMLSAXHandler(handler, lex, savedHandler.getEncoding());
         m_serializationHandler.setTransformer(this);
         executeChildTemplates(elem, true);
       }
       catch (TransformerException e)
       {
View Full Code Here

                    _method = "xml"; // default case
                }

                if (_lexHandler == null)
                {
                    result = new ToXMLSAXHandler(_handler, _encoding);
                }
                else
                {
                    result =
                        new ToXMLSAXHandler(
                            _handler,
                            _lexHandler,
                            _encoding);
                }
View Full Code Here

       
        if (nextSibling != null)
          handler.setNextSibling(nextSibling);
       
          String encoding = format.getProperty(OutputKeys.ENCODING);         
          xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding);
      }
      else if (outputTarget instanceof SAXResult)
      {
        ContentHandler handler = ((SAXResult) outputTarget).getHandler();
       
        if (null == handler)
           throw new IllegalArgumentException(
             "handler can not be null for a SAXResult");
            
        LexicalHandler lexHandler;
        if (handler instanceof LexicalHandler)    
            lexHandler = (LexicalHandlerhandler;
        else
            lexHandler = null;
           
        String encoding = format.getProperty(OutputKeys.ENCODING);
        String method = format.getProperty(OutputKeys.METHOD);

        ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding);
        toXMLSAXHandler.setShouldOutputNSAttr(false);
        xoh = toXMLSAXHandler;  


        String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC);
        String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM);
View Full Code Here

    {
      m_outputContentHandler = handler;

      if (null == m_serializationHandler)
      {
        ToXMLSAXHandler h = new ToXMLSAXHandler();
        h.setContentHandler(handler);
        h.setTransformer(this);
       
        m_serializationHandler = h;
      }
      else
        m_serializationHandler.setContentHandler(handler);
View Full Code Here

    // Save the current result tree handler.
    SerializationHandler savedRTreeHandler = this.m_serializationHandler;

    // And make a new handler for the RTF.
    ToSAXHandler h = new ToXMLSAXHandler();
    h.setContentHandler(rtfHandler);
    h.setTransformer(this);
   
    // Replace the old handler (which was already saved)
    m_serializationHandler = h;
    // use local variable for the current handler
View Full Code Here

         // %REVIEW% Make sure current node is being pushed.
         LexicalHandler lex = null;
         if (handler instanceof LexicalHandler) {
            lex = (LexicalHandler) handler;
         }
         m_serializationHandler = new ToXMLSAXHandler(handler, lex, savedHandler.getEncoding());
         m_serializationHandler.setTransformer(this);
         executeChildTemplates(elem, true);
       }
       catch (TransformerException e)
       {
View Full Code Here

TOP

Related Classes of org.apache.xml.serializer.ToXMLSAXHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.