cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <>
Subject Re: latest xform
Date Tue, 14 Aug 2001 14:49:13 GMT
> At 7:41 PM +0400 25/7/01, Piroumian, Konstantin wrote:
> >I am trying to implement setValue() and addValue() and I'm faced a
> >with XPath API. I am trying to find out is there a possibility for node
> >insertion by an XPath expression. It seems that it's not possible with
> >API.
> >Setting values is a simpler task: the node can be selected first then you
> >can set its value by setNodeValue(). But what if the node is not present
> >the document? Say, you want to set a value by xpath 'a/b/c', but if you
> >don't have 'a' and 'b' and 'c' node in your instance Document object then
> >you have to parse XPath expression then iterate from root to the child
> >create every absend node.
> >
> >Maybe somebody knows an easier solution?
> Just going back through all of this XForms stuff.
> Piroumian, in the code for FP in Cocoon 1 at
> org.apache.cocoon.processor.xsp.library.fp.fpResource there is a method
> Object sureNode(String XPath)
> Albeit a bit untidy, but it does this job.

Yes, it does, I see.
But this is not an easier (or a different) solution. I suspect that the
process of node creation is a rather slow thing. I've implemented something
like that and to create a node by a simple XPath expression it takes about
300-500ms. It's too much, in my opinion for a single node.

As I remeber in XForms expressions are restricted to be simple enough
(without predicate part). In this case it's not a difficult task to
implement a lightweight expression parser to update/add values by Simple

Btw, my name is Konstantin. Piroumian is the family name.

> regards Jeremy
> --
>    ___________________________________________________________________
>    Jeremy Quinn                                           Karma Divers
>                                                        webSpace Design
>                                             HyperMedia Research Centre
>    <>     <>
>     <phone:+44.[0].20.7737.6831>        <>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

View raw message