Create XML data from SQL queries.
XML_Query2XML heavily uses exceptions and therefore requires PHP5. Additionally one of the following database abstraction layers is required: PDO (compiled-in by default since PHP 5.1), PEAR DB, PEAR MDB2, ADOdb.
The two most important public methods this class provides are:
XML_Query2XML::getFlatXML() Transforms your SQL query into flat XML data.
XML_Query2XML::getXML() Very powerful and flexible method that can produce whatever XML data you want. It was specifically written to also handle LEFT JOINS.
They both return an instance of the class DOMDocument provided by PHP5's built-in DOM API.
A typical usage of XML_Query2XML looks like this:
Please read the tutorial for detailed usage examples and more documentation.
Located in /Query2XML.php (line 63)
Factory method.
As first argument pass an instance of PDO, PEAR DB, PEAR MDB2, ADOdb, Net_LDAP or an instance of any class that extends XML_Query2XML_Driver:
Calls XML_Query2XML::stopProfiling() and then clears the profiling data by resetting a private property.
Enable the logging of debug messages.
This will include all queries sent to the database. Example:
Transforms the data retrieved by a single SQL query into flat XML data.
This method will return a new instance of DOMDocument. The column names will be used as element names.
Example:
Returns the current value for a global option.
See XML_Query2XML::setGlobalOption() for a list of available options.
Returns all raw profiling data.
In 99.9% of all cases you will want to use getProfile().
Transforms your SQL data retrieved by one or more queries into complex and highly configurable XML data.
This method will return a new instance of DOMDocument. Please see the tutorial for details.
Register a prefix that can be used in all value specifications.
Set a global option.
Currently the following global options are available:
hidden_container_prefix: The prefix to use for container elements that are to be removed before the DOMDocument before it is returned by XML_Query2XML::getXML(). This has to be a non-empty string. The default value is '__'.
Unregister a prefix.
Documentation generated on Sun, 03 Apr 2011 13:13:11 +0200 by phpDocumentor 1.4.1