Merge branch 'patch-1' of https://github.com/dsteinbrunner/sql-translator
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / XML / SQLFairy.pm
index 3b349b5..446b60e 100644 (file)
@@ -126,7 +126,7 @@ Default is 2, set to 0 to turn off indenting.
 
 =head1 LEGACY FORMAT
 
-The previous version of the SQLFairy XML allowed the attributes of the the
+The previous version of the SQLFairy XML allowed the attributes of the
 schema objects to be written as either xml attributes or as data elements, in
 any combination. The old producer could produce attribute only or data element
 only versions. While this allowed for lots of flexibility in writing the XML
@@ -142,14 +142,13 @@ To convert your old format files simply pass them through the translator :)
 
 use strict;
 use warnings;
-use vars qw[ $VERSION @EXPORT_OK ];
-$VERSION = '1.59';
+our @EXPORT_OK;
+our $VERSION = '1.59';
 
 use Exporter;
 use base qw(Exporter);
 @EXPORT_OK = qw(produce);
 
-use IO::Scalar;
 use SQL::Translator::Utils qw(header_comment debug);
 BEGIN {
     # Will someone fix XML::Writer already?
@@ -176,14 +175,14 @@ sub produce {
     $PArgs          = $translator->producer_args;
     my $newlines    = defined $PArgs->{newlines} ? $PArgs->{newlines} : 1;
     my $indent      = defined $PArgs->{indent}   ? $PArgs->{indent}   : 2;
-    my $io          = IO::Scalar->new;
 
     # Setup the XML::Writer and set the namespace
+    my $io;
     my $prefix = "";
     $prefix    = $Name            if $PArgs->{add_prefix};
     $prefix    = $PArgs->{prefix} if $PArgs->{prefix};
     my $xml         = XML::Writer->new(
-        OUTPUT      => $io,
+        OUTPUT      => \$io,
         NAMESPACES  => 1,
         PREFIX_MAP  => { $Namespace => $prefix },
         DATA_MODE   => $newlines,
@@ -331,7 +330,7 @@ sub xml_obj_children {
 
 #
 # Takes an XML::Writer, Schema::* object and list of method names
-# and writes the obect out as XML. All methods values are written as attributes
+# and writes the object out as XML. All methods values are written as attributes
 # except for the methods listed in @MAP_AS_ELEMENTS which get written as child
 # data elements.
 #
@@ -351,7 +350,7 @@ sub xml_obj {
     my @meths              = @{ $args{'methods'} };
     my $empty_tag          = 0;
 
-    # Use array to ensure consistant (ie not hash) ordering of attribs
+    # Use array to ensure consistent (ie not hash) ordering of attribs
     # The order comes from the meths list passed in.
     my @tags;
     my @attr;