Package info.aduna.xml

Examples of info.aduna.xml.XMLWriter


    throws IOException
  {
    assert txn != null : "operation list must not be null";
    assert out != null : "output stream must not be null";

    XMLWriter xmlWriter = new XMLWriter(out);
    xmlWriter.setPrettyPrint(true);

    xmlWriter.startDocument();
    xmlWriter.startTag(TransactionXMLConstants.TRANSACTION_TAG);

    for (TransactionOperation op : txn) {
      serialize(op, xmlWriter);
    }

    xmlWriter.endTag(TransactionXMLConstants.TRANSACTION_TAG);
    xmlWriter.endDocument();
  }
View Full Code Here


   *
   * @param out
   *        The OutputStream to write the RDF/XML document to.
   */
  public TriXWriter(OutputStream out) {
    this(new XMLWriter(out));
  }
View Full Code Here

   *
   * @param writer
   *        The Writer to write the RDF/XML document to.
   */
  public TriXWriter(Writer writer) {
    this(new XMLWriter(writer));
  }
View Full Code Here

  /*--------------*
   * Constructors *
   *--------------*/

  public SPARQLResultsXMLWriter(OutputStream out) {
    this(new XMLWriter(out));
  }
View Full Code Here

  /*--------------*
   * Constructors *
   *--------------*/

  public SPARQLBooleanXMLWriter(OutputStream out) {
    this(new XMLWriter(out));
  }
View Full Code Here

                            {
                                PrintWriter out = new PrintWriter( outputStream );
                                out.println( "<?xml version='1.0' encoding='UTF-8'?>" );
                                out.println( "<?xml-stylesheet type=\"text/xsl\" href=\"query/sparqlhtml.xsl\"?>" );
                                out.flush();
                                TupleQueryResultWriter qrWriter = new SPARQLResultsXMLWriter( new XMLWriter( outputStream )
                                {
                                    @Override
                                    public void startDocument()
                                        throws IOException
                                    {
                                        // Ignore
                                    }
                                } );
                                QueryResultUtil.report( queryResult, qrWriter );
                            }
                            catch( Exception e )
                            {
                                throw new IOException( e );
                            }
                            finally
                            {
                                try
                                {
                                    conn.close();
                                }
                                catch( RepositoryException e )
                                {
                                    // Ignore
                                }
                            }
                        }
                    };
                }
                else if( variant.getMediaType().equals( MediaType.APPLICATION_RDF_XML ) )
                {
                    return new OutputRepresentation( MediaType.APPLICATION_XML )
                    {
                        @Override
                        public void write( OutputStream outputStream )
                            throws IOException
                        {
                            try
                            {
                                TupleQueryResultWriter qrWriter = new SPARQLResultsXMLWriter( new XMLWriter( outputStream ) );
                                QueryResultUtil.report( queryResult, qrWriter );
                            }
                            catch( Exception e )
                            {
                                throw new IOException( e );
View Full Code Here

   *
   * @param out
   *        The OutputStream to write the RDF/XML document to.
   */
  public TriXWriter(OutputStream out) {
    this(new XMLWriter(out));
  }
View Full Code Here

   *
   * @param writer
   *        The Writer to write the RDF/XML document to.
   */
  public TriXWriter(Writer writer) {
    this(new XMLWriter(writer));
  }
View Full Code Here

    throws IOException
  {
    assert txn != null : "operation list must not be null";
    assert out != null : "output stream must not be null";

    XMLWriter xmlWriter = new XMLWriter(out);
    xmlWriter.setPrettyPrint(true);

    xmlWriter.startDocument();
    xmlWriter.startTag(TransactionXMLConstants.TRANSACTION_TAG);

    for (TransactionOperation op : txn) {
      serialize(op, xmlWriter);
    }

    xmlWriter.endTag(TransactionXMLConstants.TRANSACTION_TAG);
    xmlWriter.endDocument();
  }
View Full Code Here

  /*--------------*
   * Constructors *
   *--------------*/

  public SPARQLResultsXMLWriter(OutputStream out) {
    this(new XMLWriter(out));
  }
View Full Code Here

TOP

Related Classes of info.aduna.xml.XMLWriter

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.