ResultSet - The XML Database ResultSet Module.
use DBIWrapper::ResultSet; my $obj = DBIWrapper::ResultSet->new();
ResultSet will contain the parsed XML file generated by readXML(). It provides a method to validate that it is complete and also a method to generate a valid XML file from the data stored in the data hash.
scalar new() Creates a new instance of the DBIWrapper::ResultSet object.
array isValid(void) Determines if the data structure is complete and usable for generating an XML file from. Returns an array. The first index is boolean (1 or 0 to indicate if the object is valid or not). The second index is an array of error messages that were generated based upon the errors found.
string displayData(style) Outputs the contents of the perl data structure after validating it. If style = 'text' then formats for the console, else if style = 'html' we generate valid html output and format in a table. The content is suitable to place straight into the <body> section of your HTML page.
string generateXML(void) Creates an XML file based upon the info stored in the ResultSet. It first calls isValid() to make sure this is possible. If not then we die with an informative error message.
version - version of the XML file parsed
resultFile - the name of the file parsed or the string of XML
sql - the SELECT statement issued which generated the XML
plug - the options that were plugged into the SQL statement
result - Ok or Error. Indicates the status returned by the database
error - The error string returned if result = Error
numRows - the number of rows returned from the database
columns - 0 or 1. Indicates if we had <column> children for each <row> or if the data returned was stored by the name given from the database in the <row> with no children tags.
rows - the array of row entries returned. Each row is a hash of column name = column value attributes.
columnNames - The names of the columns used in the XML file.
errorCodes - hash of error codes to messages returned by isValid().
NOTE: All data fields are accessible by specifying the object and pointing to the data member to be modified on the left-hand side of the assignment. Ex. $obj->variable($newValue); or $value = $obj->variable;
Xperience, Inc. (mailto:admin at pcxperience.com)
perl(1), DBIWrapper(3)