Commits

tbrugz committed 1523f9a

DumpGraphMLModel: added 'footer' snippet ; added escape method

  • Participants
  • Parent commits f2ba771

Comments (0)

Files changed (2)

File src/graphml-snippets.properties

           <y:Arrows source="none" target="standard"/>\
         </y:PolyLineEdge>\
       </data>
-      
+
+footer=</graph></graphml>

File src/tbrugz/graphml/DumpGraphMLModel.java

 
 		//end of processing
 		if(elem instanceof Root) {
-			out("</graph></graphml>", level);
+			if(hasSnippet("footer")) {
+				outSnippet("footer", level);
+			}
+			else {
+				out("</graph></graphml>", level);
+			}
 		}
 	}
 	
 		if(t.getStereotypeParamCount()>0) {
 			String[] args = new String[t.getStereotypeParamCount()];
 			for(int i=0; i<t.getStereotypeParamCount(); i++) {
-				args[i] = t.getStereotypeParam(i);
+				args[i] = escape(t.getStereotypeParam(i));
 			}
 			outSnippet(getSnippetId(t, "node"), level, args);
 		}
 			outSnippet(getSnippetId(t, "node"), level, t.getLabel());
 		}
 	}
+	
+	static String escape(String s) {
+		if(s==null) return null;
+		return s.replaceAll("&", "&amp;");
+	}
 }