作为通讯媒体,XQI(Extensible Query Interface)是一种允许使用XML远程查询和插入数据库的服务。
XQI允许远程查询和插入使用搜索引擎,但不需要CGI应用(数据可以通过其他应用传递)。
例子一:查询"Apple" 在 "Tree"
1<goxml>
2<query>
3<keyword>apple</keyword>
4<tag>tree</tag>
5</query>
6</goxml>
寻找"tree"中"apple"将进行,可以在表单中得到结果:
1<query hits="1" tag="TREE" type="URL">
2<keywords>
3<word>APPLE</word>
4</keywords>
5<hit id="234">
6<word position="0" wordcount="5">APPLE</word>
7<url>http://www.eden.org/fruit/forbidden.xml</url>
8<desription>Forbidden fruit
9<synopsis>...</synopsis>
10</desription></hit>
11</query>
例子二:查询与"apple" 有关的tag
1<goxml>
2<query>
3<keyword>apple</keyword>
4</query>
5</goxml>
可以得到与"apple" 有关的tag
1<goxml>
2<query keyword="APPLE" type="TAG">
3<hit>
4<tagname>tree</tagname>
5</hit>
6<hit>
7<tagname>fruit</tagname>
8</hit>
9</query>
10</goxml>
例子三:插入
1<goxml>
2<resource>
3<href>http://www.tree.org/orange.xml</href>
4<description>Brief 150 character description.</description>
5<category>Category Text</category>
6</resource>
7</goxml>
下面插入
1<goxml>
2<insert id="321" status="QUEUED">
3<url>http://www.tree.org/orange.xml</url>
4<description>150 character description.<./DESCRIPTION>
5</description></insert>
6</goxml>