Author: simonetripodi
Date: Mon Jan 30 14:37:17 2012
New Revision: 1237683
URL: http://svn.apache.org/viewvc?rev=1237683&view=rev
Log:
start streaming data only once keys have been collected
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java?rev=1237683&r1=1237682&r2=1237683&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java
Mon Jan 30 14:37:17 2012
@@ -93,13 +93,6 @@ final class GraphMLExporter<V extends Ve
protected void internalExport()
throws Exception
{
- XMLStreamWriter xmlWriter =
XMLOutputFactory.newInstance().createXMLStreamWriter( getWriter() );
-
- // start document tokens
- xmlWriter.writeStartDocument();
- xmlWriter.writeStartElement( GRAPHML );
- xmlWriter.writeAttribute( XMLNS, GRAPHML_XMLNS );
-
// scan graph and print TYPES description for vertex AND edges'
properties
Map<String, String> edgeKeyTypes = new HashMap<String, String>();
@@ -136,6 +129,13 @@ final class GraphMLExporter<V extends Ve
}
}
+ XMLStreamWriter xmlWriter =
XMLOutputFactory.newInstance().createXMLStreamWriter( getWriter() );
+
+ // start document tokens
+ xmlWriter.writeStartDocument();
+ xmlWriter.writeStartElement( GRAPHML );
+ xmlWriter.writeAttribute( XMLNS, GRAPHML_XMLNS );
+
xmlWriter.writeStartElement( GRAPH );
xmlWriter.writeAttribute( ID, getName() );
xmlWriter.writeAttribute( EDGEDEFAULT, DIRECTED );