Format a table via xsql.
Using the internal sqlite3 engine needs no configuration at all. Each agent has it's own data base.
Access to other data bases is controled by the
configuration variable $xsql-connection-definitions
names a file, which defines the connection parameters to connect to
the mysql data base server like this:
<?xml version="1.0" ?> <!-- Please note, this document is not (yet) dissected as it seems to be. Instead the elements MUST? occure in the correct ordering. --> <connections xml:space="default"> <connection> <name>demo</name> <database>test</database> <host>localhost</host> <user>askemos</user> <password>somepassword</password> </connection> </connections>
As you can see, this file contains plain text passwords (as it has to be to here), so keep it from prying eyes.
The first field of each line gives a name to the connection, which is used in the xsql query as the value of the connection attribute. The other columns define the connection parameters.
The query itself looks like this
<query xmlns="http://www.askemos.org/2006/XSQL/"
rowset-element="table" row-element="tr" connection="demo">
select bar as td, baz as td from foo
</query>
There should be a table called foo in your mysql data base,
which has at least the rows bar and baz,
otherwise you'll get an sql error.
When everything is correct the xsql query formats them as a html table.
<xslt:stylesheet xmlns:dsssl="dsssl" xmlns:mind="mind" xmlns:xslt="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslt:template match="*[@type="read"]">
<html>
<body bgcolor="white">
<h1>xsql example</h1>
<h2>Description</h2>
<p>Format a table via xsql.</p>
<h3>configuration preconditions</h3>
<p>Using the internal
<a href="http://www.slqite.org">sqlite3</a> engine
needs no configuration at all.
Each agent has it's own data base.
</p>
<p>Access to other data bases is controled by the
configuration variable <code>$xsql-connection-definitions</code>
names a file, which defines the connection parameters to connect to
the mysql data base server like this:</p>
<pre>
<?xml version="1.0" ?>
<!--
Please note, this document is *not* (yet) dissected as it seems to be.
Instead the elements MUST occure in the correct ordering.
-->
<connections xml:space="default">
<connection>
<name>demo</name>
<database>test</database>
<host>localhost</host>
<user>askemos</user>
<password>somepassword</password>
</connection>
</connections></pre>
<p>As you can see, this file contains plain text passwords
(as it has to be to here), so keep it from prying eyes.</p>
<p>The first field of each line gives a name to the connection,
which is used in the xsql query as the value of the connection attribute.
The other columns define the connection parameters.</p>
<h3>example code</h3>
<p>The query itself looks like this</p>
<pre>
<abbr xmlns="nu">
<query xmlns="http://www.askemos.org/2006/XSQL/"
rowset-element="table" row-element="tr" connection="demo">
select bar as td, baz as td from foo
</query></abbr>
</pre>
<p>There should be a table called <code>foo</code> in your mysql data base,
which has at least the rows <code>bar</code> and <code>baz</code>,
otherwise you'll get an sql error.
When everything is correct the xsql query formats them as a html table.</p>
</body>
</html>
</xslt:template>
</xslt:stylesheet>
Diese Seite findet man von: overview, .
Letzte Modifikation:
Autor(en): jfw,
Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391
geliefert an public
um Mon, 08 Sep 2008 20:25:23 +0200