package SQL::Translator::Producer::XML::SQLFairy;
# -------------------------------------------------------------------
-# $Id: SQLFairy.pm,v 1.4 2003-09-09 16:05:09 kycl4rk Exp $
+# $Id: SQLFairy.pm,v 1.5 2003-10-17 13:39:01 grommit Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>,
use strict;
use vars qw[ $VERSION @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/;
use Exporter;
use base qw(Exporter);
$xml->xmlDecl('UTF-8');
$xml->comment(header_comment('', ''));
- $xml->startTag([ $Namespace => 'schema' ]);
+ #$xml->startTag([ $Namespace => 'schema' ]);
+ xml_obj($xml, $schema,
+ tag => "schema", methods => [qw/name database/], end_tag => 0 );
#
# Table
}
# -------------------------------------------------------------------
+#
+# TODO
+# - Doc this sub
+# - Should the Namespace be passed in instead of global? Pass in the same
+# as Writer ie [ NS => TAGNAME ]
+#
sub xml_obj {
my ($xml, $obj, %args) = @_;
my $tag = $args{'tag'} || '';
$ans = <<EOXML;
<sqlt:schema xmlns:sqlt="http://sqlfairy.sourceforge.net/sqlfairy.xml">
+ <sqlt:name></sqlt:name>
+ <sqlt:database></sqlt:database>
<sqlt:table>
<sqlt:name>Basic</sqlt:name>
<sqlt:order>1</sqlt:order>
$ans = <<EOXML;
<sqlt:schema xmlns:sqlt="http://sqlfairy.sourceforge.net/sqlfairy.xml">
+ <sqlt:name></sqlt:name>
+ <sqlt:database></sqlt:database>
<sqlt:table>
<sqlt:name>Basic</sqlt:name>
<sqlt:order>2</sqlt:order>