From: Peter Rabbitson Date: Mon, 4 May 2009 07:10:44 +0000 (+0000) Subject: Do not add xml comment header if no_comments is set X-Git-Tag: v0.11008~163^2~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f8622fbb5267b5b8078930b44ad1ade0a478203b;p=dbsrgits%2FSQL-Translator.git Do not add xml comment header if no_comments is set --- diff --git a/lib/SQL/Translator/Producer/XML/SQLFairy.pm b/lib/SQL/Translator/Producer/XML/SQLFairy.pm index 97877e2..e9b7c47 100644 --- a/lib/SQL/Translator/Producer/XML/SQLFairy.pm +++ b/lib/SQL/Translator/Producer/XML/SQLFairy.pm @@ -187,10 +187,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; @@ -210,7 +212,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 );