> Ivelin, I have coded the changes and finally got it working.
> The part I don't like too much is where I need to get the model in order
to
> add the document to the DB. Until that part everything seems to fit quite
> nicely.
> Remember I got the model stored in a XMLDocumentContainer and now I need
the
> whole model in a DOM Node or XML String in order to add it to Xindice.

I understand. It looks like you've been in a really good mood to get this
casting to work ;)
I suggest emailing the JXPath lead Dmirti for ideas, his email is
[EMAIL PROTECTED]

>
> This is what I did:
> /**
> * Add the document to the database
> */
> public void addDocument() throws Exception {
>   try {
>     //add the document to the database
>     XindiceManager xi = new XindiceManager();
>     //needs the DocumentRoot of the container
>     xi.add(xindiceSubCol,
>
((Document)(((XMLDocumentContainer)(getForm().getModel())).getValue())).getD
> ocumentElement(), null);
>   }
>   catch (Exception e) {
>     getLogger().error("DOM Document could not be created", e);
>     throw e;
>   }
> }
>
> Yeah, what a casting experience! ;-)
> Maybe I'm missing somehting and there's an easier way in order to get what
I
> need...
>
> I prefer to send thi to the list for review by you or anybody else and
then
> I'll update the Wiki howto. Once reviewed and finished maybe this will be
a
> candidate for the official how-to docs, what do you think?

Go ahead. This will be a nice addition to the samples and how-tos.


Ivelin




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to