| 
									
										
										
										
											2008-03-07 22:28:04 -05:00
										 |  |  | USING: io io.files sequences xml xml.utilities | 
					
						
							|  |  |  | io.encodings.ascii kernel ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | IN: msxml-to-csv | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : (msxml>csv) ( xml -- table )
 | 
					
						
							|  |  |  |     "Worksheet" tag-named | 
					
						
							|  |  |  |     "Table" tag-named | 
					
						
							|  |  |  |     "Row" tags-named [ | 
					
						
							|  |  |  |         "Cell" tags-named [ | 
					
						
							|  |  |  |             "Data" tag-named children>string | 
					
						
							|  |  |  |         ] map
 | 
					
						
							|  |  |  |     ] map ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-03-07 22:28:04 -05:00
										 |  |  | : msxml>csv ( outfile infile -- )
 | 
					
						
							|  |  |  |     file>xml (msxml>csv) [ "," join ] map
 | 
					
						
							|  |  |  |     swap ascii set-file-lines ;
 |