Examples of SerializationHandler


Examples of org.apache.xml.serializer.SerializationHandler

      factory.setEncoding(_encoding);
      factory.setOutputMethod(_method);
      factory.setWriter(new FileWriter(filename, append));
      factory.setOutputType(TransletOutputHandlerFactory.STREAM);

      final SerializationHandler handler
    = factory.getSerializationHandler();

      transferOutputSettings(handler);
      handler.startDocument();
      return handler;
  }
  catch (Exception e) {
      throw new TransletException(e);
  }
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

      }
      // Pass output properties to the translet
      transferOutputProperties(_translet);
  }
     
  final SerializationHandler toHandler = getOutputHandler(result);
  if (toHandler == null) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR);
      throw new TransformerException(err.toString());
  }
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

      DTM dtm = xctxt.getDTM(sourceNode);
      short nodeType = dtm.getNodeType(sourceNode);

      if ((DTM.DOCUMENT_NODE != nodeType) && (DTM.DOCUMENT_FRAGMENT_NODE != nodeType))
      {
        SerializationHandler rthandler = transformer.getSerializationHandler();

        if (transformer.getDebug())
          transformer.getTraceManager().fireTraceEvent(this);
           
        // TODO: Process the use-attribute-sets stuff
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

    }   
      
  if (_isIdentity) {
      try {
    // Connect this object with output system directly
    SerializationHandler outputHandler =
        _transformer.getOutputHandler(result);
    _transformer.transferOutputProperties(outputHandler);

    _handler = outputHandler;
    _lexHandler = outputHandler;
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

    }

    public SerializationHandler getSerializationHandler()
        throws IOException, ParserConfigurationException
    {
        SerializationHandler result = null;
        switch (_outputType)
        {
            case STREAM :

                if (_method == null)
                {
                    result = new ToUnknownStream();
                }
                else if (_method.equalsIgnoreCase("xml"))
                {

                    result = new ToXMLStream();

                }
                else if (_method.equalsIgnoreCase("html"))
                {

                    result = new ToHTMLStream();

                }
                else if (_method.equalsIgnoreCase("text"))
                {

                    result = new ToTextStream();

                }

                if (result != null && _indentNumber >= 0)
                {
                    result.setIndentAmount(_indentNumber);
                }

                result.setEncoding(_encoding);

                if (_writer != null)
                {
                    result.setWriter(_writer);
                }
                else
                {
                    result.setOutputStream(_ostream);
                }
                return result;

            case DOM :
                _handler = (_node != null) ? new SAX2DOM(_node, _nextSibling) : new SAX2DOM();
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

 
    try
    {
      if (null != m_prefixTable)
      {
        SerializationHandler rhandler = transformer.getResultTreeHandler();
        int n = m_prefixTable.size();

        for (int i = n - 1; i >= 0; i--)
        {
          XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i);

          if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix)))
          {
            rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true);
          }
        }
      }
    }
    catch(org.xml.sax.SAXException se)
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

    try
    {
      if (null != m_prefixTable)
      {
        SerializationHandler rhandler = transformer.getResultTreeHandler();
        int n = m_prefixTable.size();

        for (int i = 0; i < n; i++)
        {
          XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i);

          if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix)))
          {
            rhandler.endPrefixMapping(decl.getPrefix());
          }
        }
      }
    }
    catch(org.xml.sax.SAXException se)
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

          TransformerImpl transformer)
            throws TransformerException
  {
    try
    {
      SerializationHandler rth = transformer.getResultTreeHandler();
      if (transformer.getDebug()) {
        // flush any pending cached processing before the trace event.
        rth.flushPending();
        transformer.getTraceManager().fireTraceEvent(this);
      }

      if (m_disableOutputEscaping)
      {
        rth.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
      }

      rth.characters(m_ch, 0, m_ch.length);

      if (m_disableOutputEscaping)
      {
        rth.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
      }
    }
    catch(SAXException se)
    {
      throw new TransformerException(se);
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

    //  the equivalent instead of getAbsolutePath()
    FileOutputStream ostream = new FileOutputStream(file.getPath(), append);
   
    try
    {
      SerializationHandler flistener =
        createSerializationHandler(transformer, ostream, file, format);
       
      try
      {
        flistener.startDocument();
      }
      catch(org.xml.sax.SAXException se)
      {
        throw new TransformerException(se);
      }
View Full Code Here

Examples of org.apache.xml.serializer.SerializationHandler

        File file,
        OutputProperties format)
        throws java.io.IOException, TransformerException
  {

      SerializationHandler serializer =
          transformer.createSerializationHandler(
              new StreamResult(ostream),
              format);
      return serializer;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.