You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stephan Michels <st...@vern.chem.tu-berlin.de> on 2002/02/25 18:26:54 UTC
XUpdate
Hi,
had somebody write a XUpdate transformer, or think about to write
a xupdate transformer?
I get some bad headache, if I write more from this:
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<xsp:structure>
<xsp:include>org.xmldb.api.base.*</xsp:include>
<xsp:include>org.xmldb.api.modules.*</xsp:include>
<xsp:include>org.xmldb.api.*</xsp:include>
</xsp:structure>
[...]
<xsp:logic>
[...]
String xupdate = "<xu:modifications version=\"1.0\"" +
" xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
" <xu:remove
select=\"/db/object[@id='"+request.getParameter("id")+"']\"/>" +
" <xu:append select=\"/db\">"+
/*" <xu:element name=\"object\"> " +
" <xu:attribute name=\"id\">"+uid+"</xu:attribute> " +
" <xu:attribute
name=\"refid\">"+request.getParameter("oid")+"</xu:attribute> " +
" </xu:element> " +*/
" <object id=\""+request.getParameter("id")+"\"" +
" basedir=\""+request.getParameter("basedir")+"\""+
" file=\""+request.getParameter("file")+"\""+
" extension=\""+request.getParameter("extension")+"\""+
" author=\""+request.getParameter("author")+"\""+
"/>"+
" </xu:append> " +
"</xu:modifications>";
XUpdateQueryService service =
(XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
service.update(xupdate);
Thanx, Stephan.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: XUpdate
Posted by Vadim Gritsenko <va...@verizon.net>.
Take a look at
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/scratchpad/src/org/apa
che/cocoon/transformation/XMLDBTransformer.java?rev=1.6&content-type=tex
t/vnd.viewcvs-markup
Vadim
> -----Original Message-----
> From: Stephan Michels [mailto:stephan@vern.chem.tu-berlin.de]
> Sent: Monday, February 25, 2002 12:27 PM
> To: cocoon-dev
> Subject: XUpdate
>
> Hi,
>
> had somebody write a XUpdate transformer, or think about to write
> a xupdate transformer?
>
> I get some bad headache, if I write more from this:
> <xsp:page language="java"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:xsp-request="http://apache.org/xsp/request/2.0">
>
> <xsp:structure>
> <xsp:include>org.xmldb.api.base.*</xsp:include>
> <xsp:include>org.xmldb.api.modules.*</xsp:include>
> <xsp:include>org.xmldb.api.*</xsp:include>
> </xsp:structure>
>
> [...]
>
> <xsp:logic>
>
> [...]
>
> String xupdate = "<xu:modifications version=\"1.0\"" +
> " xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
> " <xu:remove
> select=\"/db/object[@id='"+request.getParameter("id")+"']\"/>" +
> " <xu:append select=\"/db\">"+
> /*" <xu:element name=\"object\"> " +
> " <xu:attribute name=\"id\">"+uid+"</xu:attribute> " +
> " <xu:attribute
> name=\"refid\">"+request.getParameter("oid")+"</xu:attribute> " +
> " </xu:element> " +*/
> " <object id=\""+request.getParameter("id")+"\"" +
> " basedir=\""+request.getParameter("basedir")+"\""+
> " file=\""+request.getParameter("file")+"\""+
> "
extension=\""+request.getParameter("extension")+"\""+
> " author=\""+request.getParameter("author")+"\""+
> "/>"+
> " </xu:append> " +
> "</xu:modifications>";
>
> XUpdateQueryService service =
> (XUpdateQueryService) col.getService("XUpdateQueryService",
"1.0");
> service.update(xupdate);
>
> Thanx, Stephan.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org