The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

blx::xsdsql::xml - read/write xml file from/to sql database

SYNOPSIS

use blx::xsdsql::xml

DESCRIPTION

this package is a class - instance it with the method new

FUNCTIONS

this module defined the followed functions

new - constructor

        PARAMS:
                XMLWRITER                               => instance of class XML::Writer
                                                                                if is not set the object instance automatically
                XMLPARSER                               => instance of class XML::Parser
                                                                                if is not set the object instance automatically
                SQL_BINDING                     => instance of class blx::xsdsql::xml::sql_binding or a subclass
                                                                                if is not set the object instance automatically 
                                                                                but then params DB_NAMESPACE, DB_CONN must be set
                DB_NAMESPACE                    => set the property (Es: pg for postgres or oracle for oracle) used only if SQL_BINDING is not set
                DB_CONN                         => DBI connection used only if SQL_BINDING is not set
                SCHEMA_INSTANCE                 => schema instance (Ex: http://www.w3.org/2001/XMLSchema-instance) - default none
                                                                        this is a deprecated param - use ROOT_TAG_PARAMS param
                SCHEMA_NAME                     => schema name (Ex: schema.xsd) - default none
                                                                        this is a deprecated param - use ROOT_TAG_PARAMS param
                SCHEMA                                  => schema object generated by blx::xsdsql::parser::parse
                EXECUTE_OBJECTS_PREFIX  => prefix for objects in execution
                EXECUTE_OBJECTS_SUFFIX  => suffix for objects in execution
                ROOT_TAG_PARAMS                 => force a hash or array of key/value for root tag in write xml 
                 

read - read a xml file and put into the database

        PARAMS:
                FD   =>  input file description (default stdin) 
        the method return the id inserted into the  root table

write - write a xml file from database

        PARAMS:
                FD                                                      =>  output file descriptor (default stdout)
                ROOT_ID                                         => root_id - the result of the method read
                DELETE_ROWS                             => if true write to FD and delete the rows from the database
                ROOT_TAG_PARAMS                         => force a hash or array of key/value for root tag in write xml 
                HANDLE_BEFORE_XMLDECL           => pointer sub called before xmlDecl 
                HANDLE_AFTER_XMLDECL            => pointer sub called after xmlDecl
                HANDLE_BEFORE_START_NODE    => pointer sub called before a start node is write
                HANDLE_AFTER_START_NODE     => pointer sub called after a start node  is write
                HANDLE_BEFORE_END_NODE      => pointer sub called before a end node is write
                HANDLE_AFTER_END_NODE       => pointer sub called after a end node  is write
                HANDLE_BEFORE_DATA_ELEMENT      => pointer sub called before write dataElement
                HANDLE_AFTER_DATA_ELEMENT       => pointer sub called after write dataElement
                HANDLE_BEFORE_END                       => pointer sub called before end of document
                HANDLE_AFTER_END                        => pointer sub called after end of document
                NO_WRITE_HEADER                         => if true not write the xml header
                NO_WRITE_FOOTER                         => if true not write the xml footer

        the method return the self object if root_id exist in the database else return undef

finish - close the sql statement prepared

        the method return the self object

EXPORT

None by default.

EXPORT_OK

none

SEE ALSO

See blx:.xsdsql::generator for generate the schema of the database and blx::xsdsql::parser for parse a xsd file (schema file)

AUTHOR

lorenzo.bellotti, <pauseblx@gmail.com>

COPYRIG

Copyright (C) 2010 by lorenzo.bellotti

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html