Re: servlet response = xml document

"Iñaki Salinas Bueno" <[email protected]> Mon, 19 Feb 2007 20:55:15 +0100
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
Thanks Natalia

Your code was helpful. Now it works.

And your advice... too. I did not know how to take a look at classes from
Xindice folders clearly. Although it has not helped me either much in my
application, now I know how to use it better a little.

Regards,
Iñaki

2007/2/16, Natalia Shilenkova <[email protected]>:
>
> Hi Iñaki,
>
> On 2/15/07, Iñaki Salinas Bueno <[email protected]> wrote:
> > Hello,
> >
> >  I'm working with XForms and Xindice through a servlet. I want the
> servlet
> > response my XForms application with a XML document (content-type:
> > application/xml).
>
> The code for getting a document from a collection may look like this:
>     Resource res = col.getResource(docName);
>     if (res != null) {
>         response.setContentType("application/xml");
>         String doc = (String) res.getContent();
>         response.getOutputStream().print(doc);
>     } else {
>             // document not found
>     }
>
> where col is the collection you are trying to access and docName is a
> document key.
>
> Also, it might help to take a look at
> org/apache/xindice/tools/XMLTools.java class from Xindice source code.
> This class allows you to execute different commands on Xindice
> database, such as adding, retrieving, deleting documents and so on.
> Every supported command is implemented as a separate java class, and
> all of those classes can be found under
> org/apache/xindice/tools/commands.
>
> Regards,
> Natalia
>