cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarry Liu <javast...@gmail.com>
Subject Re: How can I put this java variable to xml attribute?
Date Fri, 08 Apr 2005 19:01:31 GMT
Carlos,

Thanks so much. I got it. 
Here is my code:

<db:query type="delete">
	<xsp:attribute name = "collection"><xsp:expr>col</xsp:expr></xsp:attribute>
	<xsp:attribute name = "oid"><xsp:expr>file</xsp:expr></xsp:attribute>

</db:query>

Jarry




On Apr 8, 2005 2:40 PM, Carlos Chávez <cchavez@agssa.net> wrote:
> 
> Jarry Liu Escribio :-)
> > Hi, everyone,
> >
> > I use xsp get the values of two strings? How can I use these variables
> > in the xml form. My code is as following. Thanks for your kind help.
> >
> > Jarry
> >
> >
> > ...
> > <xsp:logic>
> >      int i;
> >      int num = 1;
> >
> >      String col = <xsp-request:get-parameter name="dcol"/>;
> >      String filesname = <xsp-request:get-parameter name ="input"/>;
> >
> >      <!-- the filename contains several files, and looks like
> > [sample1.xml, sample2.xml] -->
> >      String fname = filesname.substring(1,filesname.length()-1);
> >
> >      StringTokenizer tk = new StringTokenizer( fname, ",");
> >      String file="";
> >
> >      while( tk.hasMoreTokens())
> >      {
> >        file = tk.nextToken();
> >
> >        <!-- Here I can get right result -->
> >               <col-name> <xsp:expr>col</xsp:expr> </col-name>;
> >             <file-name> <xsp:expr> file</xsp:expr></file-name>;
> >
> >        <!-- How can I pass the the variable to following form in
> > collection and oid respectly? -->
> >        <p><form method = "post" action="">
> >              <textarea cols="50" rows="5" style="font-family:Verdana;
> > font-weight:bold" READONLY="true">
> >                        <db:query type="delete" collection="   ???????
> > #{col}" oid= "????????#{file}" />
> 
>   Hi.
>   I think you can use the tag <xsp:attribute name="value"/>
>   for example:
> 
>   <db:query type="delete">
>       <xsp:attribute name="collection"> here put the value </xsp:attribute>
>       <xsp:attribute name="oid"> here put the value </xsp:attribute>
>   </db:query>
> 
>   Cheers.
>   Carlos Chávez.
> 
> 
> >              </textarea>
> >        </form> </p>
> >      }
> > </xsp:logic>
> > ...
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> 
> --
> Carlos Chávez
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

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


Mime
View raw message