Megatest

Diff
Login

Differences From Artifact [8d5711b7f3]:

To Artifact [edae8fdba8]:


109
110
111
112
113
114
115
116

117
118


119
120
121
122
123
124
125
126
127


128
129
130


131
132
133
134
135







136
137
138
139
140
141
142
109
110
111
112
113
114
115

116
117

118
119
120
121
122
123
124
125
126


127
128
129


130
131
132




133
134
135
136
137
138
139
140
141
142
143
144
145
146







-
+

-
+
+







-
-
+
+

-
-
+
+

-
-
-
-
+
+
+
+
+
+
+







						  (let ((colnum-a (assoc a ref-colnums))
							(colnum-b (assoc b ref-colnums)))
						    (if (and colnum-a colnum-b)
							(< (cadr colnum-a)(cadr colnum-b))
							(if (and (string? a)
								 (string? b))
							    (string< a b))))))))))
    (with-output-to-file (conc targdir "/sxml/" sheet-name ".sxml")
    (with-output-to-file (conc targdir "/xml/" sheet-name ".xml")
      (lambda ()
	(pp remaining)))))
	(print (sxml-serializer#serialize-sxml remaining))))
    sheet-name))


(define (extract-txtdb dat targdir)
  (let* ((wrkbk   (find-section   dat   'http://www.gnumeric.org/v10.dtd:Workbook))
	 (wrk-rem (remove-section dat   'http://www.gnumeric.org/v10.dtd:Workbook))
	 (sheets  (find-section   wrkbk 'http://www.gnumeric.org/v10.dtd:Sheets))
	 (sht-rem (remove-section wrkbk 'http://www.gnumeric.org/v10.dtd:Sheets)))
    (create-directory (conc targdir "/sxml") #t)
    (with-output-to-file (conc targdir "/sxml/workbook.sxml")
    (create-directory (conc targdir "/xml") #t)
    (with-output-to-file (conc targdir "/xml/workbook.xml")
      (lambda ()
	(pp wrk-rem)))
    (with-output-to-file (conc targdir "/sxml/sheets.sxml")
	(print (sxml-serializer#serialize-sxml wrk-rem))))
    (with-output-to-file (conc targdir "/xml/sheets.xml")
      (lambda ()
	(pp sht-rem)))
    (for-each (lambda (sheet)
		(sheet->txtdb sheet targdir))
	      sheets)))
	(print (sxml-serializer#serialize-sxml sht-rem))))
    (let ((sheet-names (map (lambda (sheet)
			      (sheet->txtdb sheet targdir))
			    sheets)))
      (with-output-to-file (conc targdir "/sheet-names.cfg")
	(lambda ()
	  (map print sheet-names))))))

#|  
 (define x (txtdb:read-gnumeric-xml "testdata-stripped.xml"))



;; Write out sxml