You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Peter Charles <pe...@SIMS.Berkeley.EDU> on 2004/03/07 01:57:19 UTC
Implementaion of Collection.createResource()
Hello,
On this page of the developers guide:
http://xml.apache.org/xindice/guide-developer.html#Working+with+Document
s
There is the following content:
If you had your content already in a DOM tree you could also add the
document as a DOM.
XMLResource document = (XMLResource) col.createResource(null);
document.setContentAsDOM(doc); // doc is a DOM document
col.storeResource(document);
However, createResource must take a Type Parameter
http://www.xmldb.org/xapi/api/org/xmldb/api/base/Collection.html#createR
esource(java.lang.String,%20java.lang.String)
That said I get an error of code 0 when I try and insert a DOM document.
Thanks
Peter
-----<CDE/>-----
Center for Document Engineering
University of California, Berkeley
cde.berkeley.edu
Re: Implementaion of Collection.createResource()
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Peter Charles wrote:
>Hello,
>
>On this page of the developers guide:
>
>http://xml.apache.org/xindice/guide-developer.html#Working+with+Document
>s
>
>There is the following content:
>
>If you had your content already in a DOM tree you could also add the
>document as a DOM.
>XMLResource document = (XMLResource) col.createResource(null);
>document.setContentAsDOM(doc); // doc is a DOM document
>col.storeResource(document);
>
>However, createResource must take a Type Parameter
>
>http://www.xmldb.org/xapi/api/org/xmldb/api/base/Collection.html#createR
>esource(java.lang.String,%20java.lang.String)
>
>
Thanks for pointing out; fixed in the CVS.
>That said I get an error of code 0 when I try and insert a DOM document.
>
>
Works for me (line 63):
http://cvs.apache.org/viewcvs.cgi/xml-xindice/java/tests/src/org/apache/xindice/integration/client/basic/DocumentTest.java?annotate=1.12
Vadim