cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject Re: latest xform
Date Tue, 14 Aug 2001 11:53:47 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 problem
>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 XPath
>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 in
>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 and
>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.


regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message