XML : xml-formatted stream output GEPHI-TOOLKIT

I'm writing java function using gephi-toolkit, that should produce gefx-formatted graph data, as a output stream, not a file, for further use.

If I use CharArrayWriter, or StringWriter - all xml tags being formatted as special symbols, an my output looks like this:

  <?xml version="1.0" encoding="UTF-8"?>  <gexf xmlns="http://www.gexf.net/1.2draft" version="1.2" xmlns:viz="http://www.gexf.net/1.2draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd">    <meta lastmodifieddate="2016-03-24">      <creator>Gephi 0.8.1</creator>      <description></description>    </meta>    <graph defaultedgetype="directed" mode="static">      <nodes>        <node id="1" label="n0">          <attvalues></attvalues>          <viz:size value="10.0"></viz:size>          <viz:position x="-206.8857" y="-18.469671" z="0.0"></viz:position>          <viz:color r="153" g="153" b="153"></viz:color>        </node>        <node id="2" label="n1">          <attvalues></attvalues>          <viz:size value="10.0"></viz:size>          <viz:position x="-29.136229" y="80.29351" z="0.0"></viz:position>          <viz:color r="153" g="153" b="153"></viz:color>    

What should I use to get xml-streamed data at the output?

Current code:

  //Export   ExportController ec = Lookup.getDefault().lookup(ExportController.class);     ExporterGEXF exp = (ExporterGEXF) ec.getExporter("gexf");    CharArrayWriter writer = new CharArrayWriter();     ec.exportWriter(writer, exp);   return writer;    

No comments:

Post a Comment