From: Robin V. <robinsp@gm...> - 2005-03-24 01:23:05
I'm pretty new to all this world (xmldb, xmlrpc, xslt, etc...) and I'm
very pleased with the few tests I did with exist (really great work
In my tests, I have a PHP application that interrogate exist (in a
tomcat webapp) via XMLRPC and then apply xslt files to the result to
produce output for different medias (wml and html).
By using this architecture, i was surprised by the xml result produced
by exist in response to my "query" requests.
When there is results the root element looks like this:
hits="2" start="1" count="2">
When there is no result, the root element looks like this:
<exist:result xmlns:exist="http://exist.sourceforge.net/NS/exist"; hitCount="0"/>
Is there a reason why, when there is results, the number of results is
put in "hits" parameter and when there is no results, the number 0 is
put in "hitCount" parameter ?
I'm not much experienced with applications with a heart of xml + xslt,
but i was wondering how and where to deal with this problem:
When a user make a request to my application, it transforms the
request into a "query", send it via xmlrpc and if the query goes fine,
the application applies an xsl transformation to the xml send by exist
and send the result to the user.
How do you usually proceed to add dynamic informations that is not in
the xml answer of the "query" to the displayed result ?
To be more explicit, imagine my application is a search engine for a
library, if the user enters "treasure island", i can easily produce an
xhtml file with results from the xml result of the "query". But if the
user enters "azezdfeazdzejio" and i'd like with the same xml result of
the query (empty of course) and the same xslt display "There is no
book concerning your search: azezdfeazdzejio".
I can create an xquery that will return an xml file with a header
containing the information I need...bad if i'm trying to use a
I can also modify the result from xmlrpc to add parameters or nodes
containing some new data that I need to display (modifying the result
seems not to be a good idea, isn't it ?).
If you understood what I'm trying to explain...how do you do ?
Thanks for reading up to there :)