Nathan -

I'm using VelocityViewServlet, but this template produces an HTML form if 'binds' is not defined. Is there a
way to set the content type from inside the template?

Garey



Nathan Bubna wrote:
This sounds like an issue with the content-type your servlet (the one
processing the template) is setting on the response.  Are you using
the VelocityViewServlet or your own?  if the former, are you setting
the 'default.contentType' property to 'text/xsl' in your
velocity.properties?  If not, then the servlet is telling your browser
that it's sending 'text/html' (which is the default).

On 6/8/07, Garey <[EMAIL PROTECTED]> wrote:
Hi -

    The subject kinda says it all. Here is a snippet of my template


<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="bindings.xsl" ?>

<BindReply>

    <Count>${count}</Count>

#foreach($bind in ${binds})

    <BindStatus>
        <Status>${bind.statusString}</Status>
        <ARK>ark:/${bind.noid}</ARK>
        <Message>${bind.message}</Message>
    </BindStatus>

#end

</BindReply>



    When this generates a page that is viewed by a browser, the browser
does not apply the stylesheet. If, however,  I save the generated page,
put it where I can access it via a web server and view it, the template
is applied.

Any suggestions on how to get the browser to apply a stylesheet to an
XML document generated by a Velocity template?

Garey Mills


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to