Examples of asContentHandler()


Examples of org.apache.xml.serialize.XMLSerializer.asContentHandler()

        ExternalTransaction tx = database.newTransaction();
        tx.begin();
        try {
            StringWriter writer = new StringWriter();
            XMLSerializer serializer = new XMLSerializer( writer, new OutputFormat(type, encoding, indenting) );
            ContentHandler handler = serializer.asContentHandler();
            container.extractSAX( handler, null, depth );
            writer.flush();
            tx.commit();
            return writer.toString();
        }
View Full Code Here

Examples of org.apache.xml.serialize.XMLSerializer.asContentHandler()

            throws IOException, PathNotFoundException, RepositoryException {
        boolean indenting = false;
        OutputFormat format = new OutputFormat("xml", "UTF-8", indenting);
        XMLSerializer serializer = new XMLSerializer(out, format);
        try {
            exportDocumentView(absPath, serializer.asContentHandler(),
                    skipBinary, noRecurse);
        } catch (SAXException se) {
            throw new RepositoryException(se);
        }
    }
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

                              (OutputPropertiesFactory.getDefaultMethodProperties("xml"));
      serializer.setOutputStream(fos);
  
     
      // Set the result handling to be a serialization to the file output stream.
      Result result = new SAXResult(serializer.asContentHandler());
      handler.setResult(result);
     
      // Parse the XML input document.
      reader.parse("birds.xml");
     
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

   
      // xmlFilter3 outputs SAX events to the serializer.
      Serializer serializer = SerializerFactory.getSerializer
                      (OutputPropertiesFactory.getDefaultMethodProperties("xml"));       
      serializer.setOutputStream(System.out);
      xmlFilter3.setContentHandler(serializer.asContentHandler());

      // Perform the series of transformations as follows:
      //   - transformer3 gets its parent (transformer2) as the XMLReader/XMLFilter
      //     and calls transformer2.parse(new InputSource("foo.xml")).
      //   - transformer2 gets its parent (transformer1) as the XMLReader/XMLFilter
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

   
    FileOutputStream out = new FileOutputStream(target);
    try
    {
      serializer.setOutputStream(out);
      tHLast.setResult(new SAXResult(serializer.asContentHandler()));
      reader.parse(source);
    }
    finally
    {
      // Always clean up the FileOutputStream,
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

          serializer.setOutputStream(m_outputStream);
        }
        else
          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!");

        m_resultContentHandler = serializer.asContentHandler();
      }
      catch (IOException ioe)
      {
        throw new TransformerException(ioe);
      }
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

      if (newSerializer != m_serializer)
      {
        try
        {
          m_resultContentHandler = newSerializer.asContentHandler();
        }
        catch (IOException ioe// why?
        {
          throw new SAXException(ioe);
        }
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

              serializer.setOutputStream(os);
          }

//          transformer.setSerializer(serializer);

          ContentHandler ch = serializer.asContentHandler();

          transformer.setContentHandler(ch);
        }
      }
      catch (java.io.IOException e)
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

          serializer.setOutputStream(m_outputStream);
        }
        else
          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!");

        m_resultContentHandler = serializer.asContentHandler();
      }
      catch (IOException ioe)
      {
        throw new TransformerException(ioe);
      }
View Full Code Here

Examples of org.apache.xml.serializer.Serializer.asContentHandler()

      if (newSerializer != m_serializer)
      {
        try
        {
          m_resultContentHandler = newSerializer.asContentHandler();
        }
        catch (IOException ioe// why?
        {
          throw new SAXException(ioe);
        }
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.