Click here to get back home

XML::Generator::DBI and NULL values in columns, oh my!

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
XML::Generator::DBI and NULL values in columns, oh my! pat 03-09-2006
Posted by pat on March 9, 2006, 2:24 pm
Please log in for more thread options


Mongers and Monks...

XML::Generator::DBI won't send any XML concerning a column that has a
null value. This is in the docs (I think) as:

"Nulls are handled by excluding either the attribute or the tag."

Problem is, my web service clients behave Badly(tm) when they do not
get all the tags (empty or otherwise) that they expect. All works well,
except for the lack of tags. Mind you, even when the columns are
explicitly requested in the SQL, the XML is never there.

Relevant code:

[...]
my $ya = XML::Handler::YAWriter->new(AsString => "-");
my $generator = XML::Generator::DBI->new(
Handler => $ya,
QueryElement => 'getStuff',
RowElement => 'getStuff',
dbh => $dbV->dbh
);

my $out = $generator->execute($sql);

return SOAP::Data
->name('getStuff')
->value($out)
->type('string')
->uri('urn:Stuff');
[...]

Do you think that there is an option for the module that can tell it to
send XML tags (empty) if it finds a NULL, or do you think that there is
a way to tell YAWriter to look for and compensate?

Ideas?

TIA!

pat
;)


Similar ThreadsPosted
Class::DBI::Loader. knowing table names and columns November 29, 2005, 11:35 am
AppConfig loading undef values into ARGCOUNT_LIST March 22, 2007, 2:54 pm
Spreadsheet-ParseExcel: Parsing various MS Excel file versions / grabing checkbox values? September 17, 2004, 3:11 am
yet another xml generator March 17, 2008, 9:38 pm
XML::Generator::DBI - use of uninitialized value on line 180 and 187 September 12, 2004, 8:00 pm
Regular Expression Generator June 26, 2006, 1:42 am
Free Random Password Generator January 26, 2005, 10:09 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap