Examples of StAXResult


Examples of javax.xml.transform.stax.StAXResult

            FormatXMLWriter fxmlWriter = new FormatXMLWriter(swriter);
            fxmlWriter.setWriteStartDocument(false);
//            fxmlWriter.setWriteOutline(false);

            Result result = //new StreamResult(swriter);
                    new StAXResult(fxmlWriter);
            StreamSource source = new StreamSource(sread);

            trans.transform(source, result);

            fxmlWriter.flush();
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

            _stringWriter = new StringWriter();
            try {
                XMLOutputFactory xof = XMLOutputFactory.newInstance();
                XMLStreamWriter xsw = xof.createXMLStreamWriter(_stringWriter);
                _active = true;
                return new StAXResult(xsw);
            } catch (XMLStreamException xse) {
                throw new PSQLException(GT.tr("Unable to create StAXResult for SQLXML"), PSQLState.UNEXPECTED_ERROR, xse);
            }
        }
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

    if (compiled == null)
      throw new TransformerException("Stylesheet has not been prepared.");

    if (xmlSource instanceof StAXSource && outputTarget instanceof StAXResult) {
      StAXSource in = (StAXSource) xmlSource;
      StAXResult out = (StAXResult) outputTarget;
     
      transformStream(in, out);
     
    } else {
      throw new TransformerException("The source type "+xmlSource.getClass()+" do not supported.");
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

      try {

        XMLOutputFactory xof = XMLOutputFactory.newInstance();
        XMLStreamWriter xsw = xof.createXMLStreamWriter(writer);

        return resultClass.cast(new StAXResult(xsw));
      }
      catch (XMLStreamException xse) {

        throw new SQLException("Error initializing StAXResult");
      }
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

        DOMSource domSrc= new DOMSource(xmlDocument);

        StringWriter sWiter = new StringWriter();
        XMLStreamWriter xml2format = new FormatXMLWriter(sWiter);

        StAXResult sResult = new StAXResult(xml2format);
        Result result = sResult;

        tr.transform(domSrc, result);

//        sWiter.flush();
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

            FormatXMLWriter fxmlWriter = new FormatXMLWriter(swriter);
            fxmlWriter.setWriteStartDocument(false);
//            fxmlWriter.setWriteOutline(false);

            Result result = //new StreamResult(swriter);
                    new StAXResult(fxmlWriter);
            StreamSource source = new StreamSource(sread);

            trans.transform(source, result);

            fxmlWriter.flush();
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

            throw Exceptions.resultInstantiation(ex);
        } catch (ClassCastException ex) {
            throw Exceptions.resultInstantiation(ex);
        }

        StAXResult          staxResult = createStAXResult(null);
        XMLStreamWriter     xmlWriter  = staxResult.getXMLStreamWriter();
        SAX2XMLStreamWriter handler    = new SAX2XMLStreamWriter(xmlWriter);

        result.setHandler(handler);

        return (T) result;
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

     */
    @SuppressWarnings("unchecked")
    protected <T extends Result>T createStAXResult(
            Class<T> resultClass) throws SQLException {

        StAXResult       result       = null;
        OutputStream     outputStream = this.setBinaryStreamImpl();
        Constructor      ctor;
        XMLOutputFactory factory;
        XMLStreamWriter  xmlStreamWriter;

        try {
            factory         = XMLOutputFactory.newInstance();
            xmlStreamWriter = factory.createXMLStreamWriter(outputStream);

            if (resultClass == null) {
                result = new StAXResult(xmlStreamWriter);
            } else {
                ctor   = resultClass.getConstructor(XMLStreamWriter.class);
                result = (StAXResult) ctor.newInstance(xmlStreamWriter);
            }
        } catch (SecurityException ex) {
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

   * Create a JAXP 1.4 {@link StAXResult} for the given {@link XMLStreamWriter}.
   * @param streamWriter the StAX stream writer
   * @return a result wrapping the {@code streamWriter}
   */
  public static Result createStaxResult(XMLStreamWriter streamWriter) {
    return new StAXResult(streamWriter);
  }
View Full Code Here

Examples of javax.xml.transform.stax.StAXResult

   * Create a JAXP 1.4 {@link StAXResult} for the given {@link XMLEventWriter}.
   * @param eventWriter the StAX event writer
   * @return a result wrapping {@code streamReader}
   */
  public static Result createStaxResult(XMLEventWriter eventWriter) {
    return new StAXResult(eventWriter);
  }
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.