You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gernot Koller <ge...@gmx.at> on 2003/12/18 20:37:45 UTC

Re: Problem in passing http request parameters

Hi!

Try this code:

     <xsl:variable name="var1" select="sql:id"/>
        <option
          <xsl:attribute name="value">
             <xsl:text>new.xls?dis=</xsl:text>
             <xsl:value-of select="$var1"/>
          </xsl:attribute>
               <xsl:value-of select="sql:name"/>
         </option>

hope that helps,

Gernot


> HI ALL,
>           I have to pass two paramters in an html page to the http url
> that will generate the report using cocoon like:
> 
> http://localhost:8080/cocoon/reports/new.xls?dis=MT-301&c_code=HR
> 
> There r two problems:
> 
> 1) The first parameter comes from a drop down menu, the tags r
> following:
> 
> <p align="left">
>   <select size="1" name="D1" onchange="MM_jumpMenu('parent',this,1)">
>     <option selected="SELECT">--SELECT---</option>
> 	<xsl:for-each select="sql:rowset/sql:row">
> 	  <xsl:variable name="var1" select="sql:id"/>
>  	    <option value="new.xls?dis=$var1">
>       <!--  <option value="new.xls?dis=sql:id">  -- ALSO  TRIED THIS -->
>               <xsl:value-of select="sql:name"/>
>     	    </option>
> 	</xsl:for-each>
>   </select>
> </p>
> 
> here onchange="MM_...." is from java script. The drop down menu displaying
> all entries and javascript is also working ok, but the request url is 
> "...new.xls?dis=$var1" instead of "...new.xls?dis=MT-301" (i.e. id from
> database). what can be the problem...
> 
> 
> 2) I have to pass second parameter from a simple query, where I m using
> the line:
> 
> <xsl:attribute name="HREF">&c_code=<xsl:value-of
> select="../sql:cor"/></xsl:attribute>
> 
> No problem in query, but this dosn't add to the 1st request above and I
> can't use "&" here it shows error, what's the way to do this?
> 
> Thanx in advance,
> REGARDS,
> 
> ----------------------------------------------------------------
> Sleight of hand and twist of fate,
> On a bed of nails she makes me wait...
> 
> ASHISH KUMAR,
> B. TECH. 3rd YR.
> IIT ROORKEE,
> INDIA.
> ----------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



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


Re: Problem in passing http request parameters

Posted by Lionel Crine <cr...@4dconcept.fr>.
With a variable you can write :

<option value="new.xls?dis={$var1}"> instead of  <option 
value="new.xls?dis=$var1">

But if you need to pass a node the other method (<xsl:value-of) is the one.

Lionel

At 08:27 19/12/2003 +0100, you wrote:
>Ashish Kumar wrote:
>>>>2) I have to pass second parameter from a simple query, where I m using
>>>>the line:
>>>>
>>>><xsl:attribute name="HREF">&c_code=<xsl:value-of
>
>Please remember that "&" starts an entity in XML. Exactly for this
>reason there is an entity representing "&": "&amp;"
>
>Hence the above code will complain about an error in the naming of
>an entity since it considers &c_code (missing ";") as such. Replace with
>&amp;c_code= and all'll be fine.
>
>         Chris.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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


Re: Problem in passing http request parameters

Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Ashish Kumar wrote:
>>>2) I have to pass second parameter from a simple query, where I m using
>>>the line:
>>>
>>><xsl:attribute name="HREF">&c_code=<xsl:value-of

Please remember that "&" starts an entity in XML. Exactly for this
reason there is an entity representing "&": "&amp;"

Hence the above code will complain about an error in the naming of
an entity since it considers &c_code (missing ";") as such. Replace with
&amp;c_code= and all'll be fine.

	Chris.

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


Re: Problem in passing http request parameters

Posted by Ashish Kumar <ng...@iitr.ernet.in>.
HI there,
          Thanx, it worked, but I m still hanging with the second problem,
i.e. how to pass more than one parameter.

Any help Plz....

REGARDS.
ASHISH


On Thu, 18 Dec 2003, Gernot Koller wrote:

> Hi!
> 
> Try this code:
> 
>      <xsl:variable name="var1" select="sql:id"/>
>         <option
>           <xsl:attribute name="value">
>              <xsl:text>new.xls?dis=</xsl:text>
>              <xsl:value-of select="$var1"/>
>           </xsl:attribute>
>                <xsl:value-of select="sql:name"/>
>          </option>
> 
> hope that helps,
> 
> Gernot
> 
> 
> > HI ALL,
> >           I have to pass two paramters in an html page to the http url
> > that will generate the report using cocoon like:
> > 
> > http://localhost:8080/cocoon/reports/new.xls?dis=MT-301&c_code=HR
> > 
> > There r two problems:
> > 
> > 1) The first parameter comes from a drop down menu, the tags r
> > following:
> > 
> > <p align="left">
> >   <select size="1" name="D1" onchange="MM_jumpMenu('parent',this,1)">
> >     <option selected="SELECT">--SELECT---</option>
> > 	<xsl:for-each select="sql:rowset/sql:row">
> > 	  <xsl:variable name="var1" select="sql:id"/>
> >  	    <option value="new.xls?dis=$var1">
> >       <!--  <option value="new.xls?dis=sql:id">  -- ALSO  TRIED THIS -->
> >               <xsl:value-of select="sql:name"/>
> >     	    </option>
> > 	</xsl:for-each>
> >   </select>
> > </p>
> > 
> > here onchange="MM_...." is from java script. The drop down menu displaying
> > all entries and javascript is also working ok, but the request url is 
> > "...new.xls?dis=$var1" instead of "...new.xls?dis=MT-301" (i.e. id from
> > database). what can be the problem...
> > 
> > 
> > 2) I have to pass second parameter from a simple query, where I m using
> > the line:
> > 
> > <xsl:attribute name="HREF">&c_code=<xsl:value-of
> > select="../sql:cor"/></xsl:attribute>
> > 
> > No problem in query, but this dosn't add to the 1st request above and I
> > can't use "&" here it shows error, what's the way to do this?
> > 
> > Thanx in advance,
> > REGARDS,
> > 
> > ----------------------------------------------------------------
> > Sleight of hand and twist of fate,
> > On a bed of nails she makes me wait...
> > 
> > ASHISH KUMAR,
> > B. TECH. 3rd YR.
> > IIT ROORKEE,
> > INDIA.
> > ----------------------------------------------------------------
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> 
> -- 
> +++ GMX - die erste Adresse f�r Mail, Message, More +++
> Neu: Preissenkung f�r MMS und FreeMMS! http://www.gmx.net
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

----------------------------------------------------------------
Sleight of hand and twist of fate,
On a bed of nails she makes me wait...

ASHISH KUMAR,
B. TECH. 3rd YR.
IIT ROORKEE,
INDIA.
----------------------------------------------------------------


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