[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Calling any servlet within xml


Subject: Calling any servlet within xml
From: Mala Ramakrishnan <mala@xxxxxxxxxxxxx>
Date: Thu, 2 Nov 2000 17:27:38 -0400 (EST)

Hi,

I can't seem to figure out what could be wrong with my code, maybe I'm
just not doing this the right way, it's my first time. I used pieces of
information from the archives to do this.

I need to pass in parameters to an xml file - which are the servlet url,
and a couple of parameters for the servlet. The servlet returns an xml
file which has info to create a form. I get a blank screen on my browser
when I call the xml file. Here is how my code looks:

HandleForm.xml
---------------

<?xml version="1.0"?>
<?cocoon-process type="xsp"?> 
<?xml-stylesheet href="HandleForm.xsl" type="text/xsl"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core"
          xmlns:util="http://www.apache.org/1999/XSP/Util">
<page>

    <xsl:element name="util:include-uri">
       <xsl:attribute name="href">
       <xsp:logic>

        <![CDATA[
          String[] url = request.getParameters("url"); 
          String[] op = request.getParameters("operation");
          String[] stage = request.getParameters("stage");
         ]]>     

         <xsl:value-of select=
                "concat(url, '?operation=', op, '&amp;stage=', stage)"
/>
       </xsp:logic>    
       </xsl:attribute>  
    </xsl:element>

</page>
</xsp:page>
</xsl:stylesheet>

HandleForm.xsl
---------------
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core"
          xmlns:util="http://www.apache.org/1999/XSP/Util">

<xsl:template match="input">
 <xsl:processing-instruction name="cocoon-format">
        type="text/html"
 </xsl:processing-instruction>
       
 <html>
   <head>
       <title> New Router </title>
   </head>
    <body bgcolor="#ffffff">
       Hiya! The formatting for the xml returned by the servlet   		goes
here.
    </body>
   </html>
</xsl:template>
</xsp:page>
</xsl:stylesheet>
~




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml