cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Arnold <d...@starnix.com>
Subject FP taglib bug
Date Wed, 29 Nov 2000 18:54:24 GMT
I've been trying to use FP to write some new "records" to an XML file.  
I understand that an <fp:write> tag is supposed to create any nodes 
needed to create the final node of the select clause.  My problem is 
that fp:write doesn't actually do this - it writes all nodes as children 
of the resource node. 

I've attached the patch (to fpResource.java) to get things working properly.

An example:

<fp:resource id="MYRES">
   <fp:resource-file>file.xml</fp:resource-file>
   <fp:resource-node>LEVELONE[position()=<request:get-parameter 
name="levelone"/>]</fp:resource-node>
   <fp:default-mode>insert-before</fp:default-mode>
</fp:resource>

<fp:write select="DATA/SUBDATA" to="MYRES">
   <request:get-parameter name="subdata"/>
</fp:write>

would take a file.xml that looks like:

<ROOT>
   <LEVELONE>
       <DATA>Filler</DATA>
   </LEVELONE>
</ROOT>

and turn it into:

<ROOT>
   <LEVELONE>
       <SUBDATA>Filler</SUBDATA>
   </LEVELONE>
   <LEVELONE>
       <DATA>Filler</DATA>
   </LEVELONE>
</ROOT>

instead of:

<ROOT>
   <LEVELONE>
       <DATA>
            <SUBDATA>Filler</SUBDATA>
       </DATA>
   </LEVELONE>
   <LEVELONE>
       <DATA>Filler</DATA>
   </LEVELONE>
</ROOT>

D.

-- 
David Arnold <dave@starnix.com>                               starnix inc.
tollfree: 1-87-pro-linux                        thornhill, ontario, canada
http://www.starnix.com              professional linux services & products

Mime
View raw message