aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExportFileUtilities.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-11-05 21:15:18 +0000
committerstuconnolly <stuart02@gmail.com>2010-11-05 21:15:18 +0000
commita9be9780875d249019bd0cdf55eba960fb6f44be (patch)
treeaf7477b3e9c964dedf67ff40385f5724713ccc03 /Source/SPExportFileUtilities.m
parentf683094590e4a95eb047893584493ed7b32e2a02 (diff)
downloadsequelpro-a9be9780875d249019bd0cdf55eba960fb6f44be.tar.gz
sequelpro-a9be9780875d249019bd0cdf55eba960fb6f44be.tar.bz2
sequelpro-a9be9780875d249019bd0cdf55eba960fb6f44be.zip
Complete the implementation of supporting MySQL's XML schema format when exporting. Also, restore our old format and give the user the choice during export (defaults to MySQL schema). Completes the implementation of issue #840.
Diffstat (limited to 'Source/SPExportFileUtilities.m')
-rw-r--r--Source/SPExportFileUtilities.m11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/SPExportFileUtilities.m b/Source/SPExportFileUtilities.m
index fd4be8b0..86631495 100644
--- a/Source/SPExportFileUtilities.m
+++ b/Source/SPExportFileUtilities.m
@@ -86,13 +86,16 @@
[header appendFormat:@"- %@: %@\n", NSLocalizedString(@"Database", @"export header database label"), [tableDocumentInstance database]];
[header appendFormat:@"- %@ Time: %@\n", NSLocalizedString(@"Generation Time", @"export header generation time label"), [NSDate date]];
[header appendString:@"-\n-->\n\n"];
- [header appendFormat:@"<%@ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n", (exportSource == SPTableExport) ? @"mysqldump" : @"resultset"];
- if (exportSource == SPTableExport) {
- [header appendFormat:@"<database name=\"%@\">\n\n", [tableDocumentInstance database]];
+ if ([exportXMLFormatPopUpButton indexOfSelectedItem] == SPXMLExportMySQLFormat) {
+ [header appendFormat:@"<%@ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n", (exportSource == SPTableExport) ? @"mysqldump" : @"resultset"];
+
+ if (exportSource == SPTableExport) {
+ [header appendFormat:@"<database name=\"%@\">\n\n", [tableDocumentInstance database]];
+ }
}
else {
- [header appendString:@"\n"];
+ [header appendFormat:@"<%@>\n\n", [[tableDocumentInstance database] HTMLEscapeString]];
}
[file writeData:[header dataUsingEncoding:NSUTF8StringEncoding]];