Changeset 2603

Show
Ignore:
Timestamp:
11/18/08 13:59:34 (2 months ago)
Author:
pataphil
Message:

Got rid of that pesty newline bug!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plugins/converter/edu.iu.nwb.converter.nwbgraphml/src/edu/iu/nwb/converter/nwbgraphml/NWBToGraphMLbyStax.java

    r2601 r2603  
    9999                        try { 
    100100                                xtw.writeEndElement(); 
    101                                 xtw.writeCharacters("\r\n"); 
     101                                 
    102102                                xtw.writeEndElement(); 
    103103                        } catch (Exception e) { 
     
    129129 
    130130                xtw.writeStartDocument("UTF-8","1.0"); 
    131                 xtw.writeCharacters("\r\n"); 
    132131                xtw.writeComment("This file is generated by XMLStreamWriter"); 
    133                 xtw.writeCharacters("\r\n"); 
    134132                xtw.writeStartElement("graphml"); 
    135133                xtw.writeNamespace("", "http://graphml.graphdrawing.org/xmlns");  
     
    139137                                "schemaLocation",  
    140138                "http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"); 
    141                 xtw.writeCharacters("\r\n"); 
    142139 
    143140        } 
     
    161158                        xtw.writeAttribute("attr.type", getGraphmlType(attr)); 
    162159                        xtw.writeEndElement(); 
    163                         xtw.writeCharacters("\r\n"); 
    164160                } 
    165161 
     
    181177                                xtw.writeAttribute("attr.type", getGraphmlType(attr)); 
    182178                                xtw.writeEndElement(); 
    183                                 xtw.writeCharacters("\r\n"); 
    184179 
    185180                        } 
     
    204199                                xtw.writeAttribute("attr.type", attr.getDataType()); 
    205200                                xtw.writeEndElement(); 
    206                                 xtw.writeCharacters("\r\n"); 
     201                                 
    207202                        } 
    208203                        xtw.writeStartElement("graph"); 
    209204                        xtw.writeAttribute("edgedefault", "undirected"); 
    210                         xtw.writeCharacters("\r\n"); 
     205                         
    211206                } 
    212207                else if (validator.isDirectedGraph() && validator.isUndirectedGraph()){ 
     
    291286                                        xtw.writeStartElement("node"); 
    292287                                        xtw.writeAttribute("id", "n" + columns[0]); 
    293                                         xtw.writeCharacters("\r\n"); 
     288                                         
    294289 
    295290                                        for(int i = 1; i<nodeAttrList.size(); i++){ 
     
    312307                                                        xtw.writeCharacters(value); 
    313308                                                        xtw.writeEndElement();   
    314                                                         xtw.writeCharacters("\r\n"); 
     309                                                         
    315310 
    316311                                                } else { 
     
    326321                                        //write </node> 
    327322                                        xtw.writeEndElement(); 
    328                                         xtw.writeCharacters("\r\n"); 
     323                                         
    329324 
    330325                                } 
     
    363358                                                        xtw.writeAttribute("source", "n" + columns[sourceColumnNumber]); 
    364359                                                        xtw.writeAttribute("target", "n" + columns[targetColumnNumber]); 
    365                                                         xtw.writeCharacters("\r\n"); 
     360                                                         
    366361 
    367362                                                        for(int i = 0; i<edgeAttrList.size(); i++){ 
     
    388383                                                                                xtw.writeCharacters(value); 
    389384                                                                                xtw.writeEndElement(); 
    390                                                                                 xtw.writeCharacters("\r\n"); 
     385                                                                                 
    391386                                                                        } else { 
    392387                                                                                /* 
     
    402397                                                        //write </edge> 
    403398                                                        xtw.writeEndElement(); 
    404                                                         xtw.writeCharacters("\r\n"); 
     399                                                         
    405400                                                         
    406401                                                }else{ 
     
    412407                                                        xtw.writeAttribute("target", "n" + columns[targetColumnNumber]); 
    413408                                                        xtw.writeEndElement(); 
    414                                                         xtw.writeCharacters("\r\n"); 
     409                                                         
    415410                                                         
    416411                                                } 
     
    425420                                                        xtw.writeAttribute("source", "n" + columns[sourceColumnNumber]); 
    426421                                                        xtw.writeAttribute("target", "n" + columns[targetColumnNumber]); 
    427                                                         xtw.writeCharacters("\r\n"); 
     422                                                         
    428423 
    429424                                                        for(int i = 0; i<edgeAttrList.size(); i++){ 
     
    442437                                                                                xtw.writeCharacters(columns[i]); 
    443438                                                                                xtw.writeEndElement(); 
    444                                                                                 xtw.writeCharacters("\r\n"); 
     439                                                                                 
    445440                                                                                 
    446441                                                                        } else { 
     
    468463                                                        xtw.writeAttribute("target", "n" + columns[targetColumnNumber]); 
    469464                                                        xtw.writeEndElement(); 
    470                                                         xtw.writeCharacters("\r\n"); 
    471                                                          
    472465                                                } 
    473466                                        }