You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Stephane MOR <st...@yahoo.fr> on 2002/01/06 05:51:40 UTC

[Turbine] : Templates - XML Output - Problem : How to remove default HTML tags ?

Hello,

I am using Turbine 2.1, along with Velocity 1.2 as a templating engine.
Turbine rocks and I'm very happy with it !

I try and have a VelocityScreen to output an XML Stream.
I have :
- a VelocityScreen called XMLScreen :
    public class XMLScreen {
        public void doBuildTemplate(RunData data, Context context){
            context.put("input", ":: Testing the input ::");
        }
    }

- a Layout called "Xml.vm" :
    <?xml version="1.0" encoding="ISO-8859-1"?>
    $screen_placeholder

- a template "XMLScreen" :
    $data.setLayoutTemplate("/Xml.vm")
    <app>
        <input>$input</input>
    </app>

I would like , when I call
http://localhost:8080/myapp/servlet/myapp/XMLScreen.vm , to have :

<?xml version="1.0" encoding="ISO-8859-1"?>
<app>
    <input>:: Testing the input ::</input>
</app>

, but I have :

<html><head><title></title></head><body><?xml version="1.0"
encoding="ISO-8859-1"?>
<app>
    <input>:: Testing the input ::</input>
</app></body></html>

Could anyone please tell me where these tags are added , and / or with class
to subclass
(as this doesn't appear in any templates / layouts, I guess it is
hardcoded ).

I read something about VelocitySiteLayout in the docs, but don't have any
idea on how to use it.

Thanks,
Stephane


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Turbine] : Templates - XML Output - Problem : How to remove default HTML tags ?

Posted by Scott Eade <se...@backstagetech.com.au>.
Look in TurbineResources.properties.  You need:

services.VelocityService.default.layout = VelocityOnlyLayout

I assume there is some way of setting this for a specific
template, but I haven't tried it myself.

HTH,

Scott

----- Original Message -----
From: "Stephane MOR" <st...@yahoo.fr>
To: <tu...@jakarta.apache.org>
Sent: Sunday, January 06, 2002 3:51 PM
Subject: [Turbine] : Templates - XML Output - Problem : How to remove
default HTML tags ?


> Hello,
>
> I am using Turbine 2.1, along with Velocity 1.2 as a templating engine.
> Turbine rocks and I'm very happy with it !
>
> I try and have a VelocityScreen to output an XML Stream.
> I have :
> - a VelocityScreen called XMLScreen :
>     public class XMLScreen {
>         public void doBuildTemplate(RunData data, Context context){
>             context.put("input", ":: Testing the input ::");
>         }
>     }
>
> - a Layout called "Xml.vm" :
>     <?xml version="1.0" encoding="ISO-8859-1"?>
>     $screen_placeholder
>
> - a template "XMLScreen" :
>     $data.setLayoutTemplate("/Xml.vm")
>     <app>
>         <input>$input</input>
>     </app>
>
> I would like , when I call
> http://localhost:8080/myapp/servlet/myapp/XMLScreen.vm , to have :
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <app>
>     <input>:: Testing the input ::</input>
> </app>
>
> , but I have :
>
> <html><head><title></title></head><body><?xml version="1.0"
> encoding="ISO-8859-1"?>
> <app>
>     <input>:: Testing the input ::</input>
> </app></body></html>
>
> Could anyone please tell me where these tags are added , and / or with
class
> to subclass
> (as this doesn't appear in any templates / layouts, I guess it is
> hardcoded ).
>
> I read something about VelocitySiteLayout in the docs, but don't have any
> idea on how to use it.
>
> Thanks,
> Stephane
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Turbine] : Templates - XML Output - Problem : How to remove default HTML tags ?

Posted by Stephane MOR <st...@yahoo.fr>.
Thanks a lot, Scott and Jason !

Not even in 20 minutes, I had the solution to my problem !

Definitely, Open Source rocks !

Cheers,
Stephane


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Turbine] : Templates - XML Output - Problem : How to remove default HTML tags ?

Posted by Jason van Zyl <jv...@zenplex.com>.
On 1/5/02 11:51 PM, "Stephane MOR" <st...@yahoo.fr> wrote:

> Hello,
> 

> 
> Could anyone please tell me where these tags are added , and / or with class
> to subclass
> (as this doesn't appear in any templates / layouts, I guess it is
> hardcoded ).

They are coming from the VelocityECSLayout which is probably set as the
default layout module in your TurbineResource.properties file. If you want
fully control over the output you should use the VelocityOnlyLayout.
 
> I read something about VelocitySiteLayout in the docs, but don't have any
> idea on how to use it.

I don't have easy access to my Turbine stuff at the moment but you'll want
to look for VelocityECSLayout and replace it with VelocityOnlyLayout and you
should get your desired result.
 
> Thanks,
> Stephane
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>