Upped version numbers, cleaned up code, fixed my name.
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / XML / SQLFairy.pm
index 60e9eea..bd6afe4 100644 (file)
@@ -1,12 +1,7 @@
 package SQL::Translator::Producer::XML::SQLFairy;
 
 # -------------------------------------------------------------------
-# $Id: SQLFairy.pm 1440 2009-01-17 16:31:57Z jawnsy $
-# -------------------------------------------------------------------
-# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
-#                    darren chamberlain <darren@cpan.org>,
-#                    Chris Mungall <cjm@fruitfly.org>,
-#                    Mark Addison <mark.addison@itn.co.uk>.
+# Copyright (C) 2003-9 SQLFair Authors.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -165,7 +160,7 @@ To convert your old format files simply pass them through the translator :)
 
 use strict;
 use vars qw[ $VERSION @EXPORT_OK ];
-$VERSION = '1.99';
+$VERSION = '1.60';
 
 use Exporter;
 use base qw(Exporter);
@@ -189,10 +184,12 @@ my @MAP_AS_ELEMENTS = qw/sql comments action extra/;
 my $Namespace = 'http://sqlfairy.sourceforge.net/sqlfairy.xml';
 my $Name      = 'sqlf';
 my $PArgs     = {};
+my $no_comments;
 
 sub produce {
     my $translator  = shift;
     my $schema      = $translator->schema;
+    $no_comments    = $translator->no_comments;
     $PArgs          = $translator->producer_args;
     my $newlines    = defined $PArgs->{newlines} ? $PArgs->{newlines} : 1;
     my $indent      = defined $PArgs->{indent}   ? $PArgs->{indent}   : 2;
@@ -212,7 +209,10 @@ sub produce {
 
     # Start the document
     $xml->xmlDecl('UTF-8');
-    $xml->comment(header_comment('', ''));
+
+    $xml->comment(header_comment('', ''))
+      unless $no_comments;
+
     xml_obj($xml, $schema,
         tag => "schema", methods => [qw/name database extra/], end_tag => 0 );
 
@@ -288,7 +288,7 @@ sub produce {
     #
     xml_obj_children( $xml, $schema,
         tag    => 'trigger',
-        methods => [qw/name database_event action on_table perform_action_when
+        methods => [qw/name database_events action on_table perform_action_when
             fields order extra/],
     );
 
@@ -408,7 +408,7 @@ sub xml_obj {
 
 =head1 AUTHORS
 
-Ken Y. Clark E<lt>kclark@cpan.orgE<gt>,
+Ken Youens-Clark E<lt>kclark@cpan.orgE<gt>,
 Darren Chamberlain E<lt>darren@cpan.orgE<gt>,
 Mark Addison E<lt>mark.addison@itn.co.ukE<gt>.