Jim Lah Posted January 26, 2010 Posted January 26, 2010 I am new to the world of XML and XSL and am struggling with how to transform a Filemaker output which is a series of table outputs all related back to a single record of the form: <?xml version="1.0" encoding="UTF-8"?> 0 249 250 251 252 253 254 255 256 257 258 259 260 261 249 250 251 252 253 254 255 256 257 258 259 260 261 MLP John Bill James Andy Jamie Danny Chris Tom Arianna George Beth Charlie 249 249 249 249 250 251 252 252 252 253 253 253 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 M1 M2 M3 JJ1 JJ2 JJ3 B1 B2 B3 J1 J2 J3 A1 A2 A3 JJJ1 JJJ2 JJJ3 D1 D2 D3 C1 C2 C3 249 249 249 250 250 250 251 251 251 252 252 252 253 253 253 254 254 254 255 255 255 256 256 256 Into a form that will simply import one of the sets of Data into a table of the form: <?xml version="1.0" encoding="UTF-8"?> 0 249 MLP 250 John 249 251 Bill 249 252 James 249 253 Andy 249 254 Jamie 250 255 Danny 251 256 Chris 252 257 Tom 252 258 Arianna 252 259 George 253 260 Beth 253 261 Charlie 253 Ie data from a single table. Can anyone point me to an easy reference that will get me there. Thanks, Jim
comment Posted January 26, 2010 Posted January 26, 2010 Why is this necessary? Can't you export from the Persons table in the original file?
Jim Lah Posted January 26, 2010 Author Posted January 26, 2010 No, I wish to create a single export XML file that contains the data of multiple tables, that I can then re-import as needed to the relevant tables one at a time. Jim
comment Posted January 26, 2010 Posted January 26, 2010 (edited) I see - but you are not making it easy for yourself. IMHO, it would be much simpler to deal with a flat file exported from the Comments table, or (if there may be a person without any comments) at least from the Persons table. That is, if one excludes the most straightforward approach of exporting each table separately. Edited January 26, 2010 by Guest
comment Posted January 26, 2010 Posted January 26, 2010 Anyway, I believe this should do what you want: <?xml version="1.0" encoding="UTF-8"?> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fmp="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fmp"> 0
Jim Lah Posted January 26, 2010 Author Posted January 26, 2010 Many thanks - that does help my understanding a lot. Obviously I would like to find a way of doing this that minimises the amount of effort. If I do as you say and export to separate flat files for each table - then I end up with a series of files that the user has to ensure he keeps together. Unless there's a way of combining them into another file or package. The purpose is to be able to archive and share data between users, eg by sending files via email for import into someone elses client. There's no server available. My challenge is that the real application has about 10 tables, some related data, some not. Each table may have 20 or so fields. So writing XML and XSL this way is likely to be error prone. What would be the recommended approach to this?
comment Posted January 27, 2010 Posted January 27, 2010 When I said "flat file", I meant export from the most atomic table, with related parent data included (and duplicated for each child). It seems you are now exporting from some "super-parent" table which holds no meaningful data. As a result, the real data is scattered and needs to be collected carefully - while exporting from a "real" table would enclose each record in its own element. Unrelated data is another issue. I believe it should be possible, with some very careful scripting, to export all tables one-by-one, with the last one "collecting" all previously exported files into a single document - but I don't recall if I actually ever tried this.
Recommended Posts
This topic is 5412 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now