HTML in response stream

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

HTML in response stream

coriolisguy
Hi all,

I have a situtation where each component in my page is
generating XML and as a final step when they are all
finished, I need to take that and style it with an XSL
into HTML. I will then allow that HTML to go out on
the response stream. How and when do I intercept the
response stream to pull the XML and replace it with
HTML?

Thanks
E



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTML in response stream

Andreas Andreou-4
There are just too many ways to do that...
1) Write a servlet filter that applies the xslt

2) Write a tapestry component that surrounds everything in your pages,
override its renderComponent() and
    a) make it render its body in a "buffer" (there's a renderBody() method)
    b) apply xslt to the buffer
    c) write the results with writer.printRaw()

3) Take a look at AbstractEngine and override something from there :)
That would probably be renderResponse()

Anyway, just try 1) or 2) ...
And maybe there's a component like the one i descibed in Tassel

> Hi all,
>
> I have a situtation where each component in my page is
> generating XML and as a final step when they are all
> finished, I need to take that and style it with an XSL
> into HTML. I will then allow that HTML to go out on
> the response stream. How and when do I intercept the
> response stream to pull the XML and replace it with
> HTML?
>
> Thanks
> E



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: HTML in response stream

Robert J. Walker
In reply to this post by coriolisguy
I'm not sure what the level of support is for this method, but yet
another way to do this is to simply pass the XML to the client, linking
in the XSL stylesheet and allowing the client to transform it.

Robert

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Sunday, May 15, 2005 4:38 PM
To: Tapestry users
Subject: Re: HTML in response stream


There are just too many ways to do that...
1) Write a servlet filter that applies the xslt

2) Write a tapestry component that surrounds everything in your pages,
override its renderComponent() and
    a) make it render its body in a "buffer" (there's a renderBody()
method)
    b) apply xslt to the buffer
    c) write the results with writer.printRaw()

3) Take a look at AbstractEngine and override something from there :)
That would probably be renderResponse()

Anyway, just try 1) or 2) ...
And maybe there's a component like the one i descibed in Tassel

> Hi all,
>
> I have a situtation where each component in my page is
> generating XML and as a final step when they are all
> finished, I need to take that and style it with an XSL
> into HTML. I will then allow that HTML to go out on
> the response stream. How and when do I intercept the
> response stream to pull the XML and replace it with
> HTML?
>
> Thanks
> E



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: HTML in response stream

Patrick Casey

        Does anyone have any recent experience with client-side XSL
transforms? Historically I've been nervous about trusting the browsers to
transform predictably so I've preferred server-side transforms, but I might
just be an old nervous fogey on this one.

        Is it safe to trust the client to transform these days?
       
        --- Pat

> -----Original Message-----
> From: Robert Walker [mailto:[hidden email]]
> Sent: Monday, May 16, 2005 6:57 AM
> To: Tapestry users
> Subject: RE: HTML in response stream
>
> I'm not sure what the level of support is for this method, but yet
> another way to do this is to simply pass the XML to the client, linking
> in the XSL stylesheet and allowing the client to transform it.
>
> Robert
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Sunday, May 15, 2005 4:38 PM
> To: Tapestry users
> Subject: Re: HTML in response stream
>
>
> There are just too many ways to do that...
> 1) Write a servlet filter that applies the xslt
>
> 2) Write a tapestry component that surrounds everything in your pages,
> override its renderComponent() and
>     a) make it render its body in a "buffer" (there's a renderBody()
> method)
>     b) apply xslt to the buffer
>     c) write the results with writer.printRaw()
>
> 3) Take a look at AbstractEngine and override something from there :)
> That would probably be renderResponse()
>
> Anyway, just try 1) or 2) ...
> And maybe there's a component like the one i descibed in Tassel
>
> > Hi all,
> >
> > I have a situtation where each component in my page is
> > generating XML and as a final step when they are all
> > finished, I need to take that and style it with an XSL
> > into HTML. I will then allow that HTML to go out on
> > the response stream. How and when do I intercept the
> > response stream to pull the XML and replace it with
> > HTML?
> >
> > Thanks
> > E
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: HTML in response stream

David Leangen

Although browsers have come a long way in terms of XML support, personally I
wouldn't yet put my faith in that approach for at least another few years.

I've tried it out casually, so to speak, and that was my conclusion. I would
definately not do it in a production environment, but that's just me.


Cheers,
Dave




> -----Original Message-----
> From: Patrick Casey [mailto:[hidden email]]
> Sent: 17 May 2005 01:09
> To: 'Tapestry users'
> Subject: RE: HTML in response stream
>
>
>
> Does anyone have any recent experience with client-side XSL
> transforms? Historically I've been nervous about trusting the browsers to
> transform predictably so I've preferred server-side transforms,
> but I might
> just be an old nervous fogey on this one.
>
> Is it safe to trust the client to transform these days?
>
> --- Pat
>
> > -----Original Message-----
> > From: Robert Walker [mailto:[hidden email]]
> > Sent: Monday, May 16, 2005 6:57 AM
> > To: Tapestry users
> > Subject: RE: HTML in response stream
> >
> > I'm not sure what the level of support is for this method, but yet
> > another way to do this is to simply pass the XML to the client, linking
> > in the XSL stylesheet and allowing the client to transform it.
> >
> > Robert
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]]
> > Sent: Sunday, May 15, 2005 4:38 PM
> > To: Tapestry users
> > Subject: Re: HTML in response stream
> >
> >
> > There are just too many ways to do that...
> > 1) Write a servlet filter that applies the xslt
> >
> > 2) Write a tapestry component that surrounds everything in your pages,
> > override its renderComponent() and
> >     a) make it render its body in a "buffer" (there's a renderBody()
> > method)
> >     b) apply xslt to the buffer
> >     c) write the results with writer.printRaw()
> >
> > 3) Take a look at AbstractEngine and override something from there :)
> > That would probably be renderResponse()
> >
> > Anyway, just try 1) or 2) ...
> > And maybe there's a component like the one i descibed in Tassel
> >
> > > Hi all,
> > >
> > > I have a situtation where each component in my page is
> > > generating XML and as a final step when they are all
> > > finished, I need to take that and style it with an XSL
> > > into HTML. I will then allow that HTML to go out on
> > > the response stream. How and when do I intercept the
> > > response stream to pull the XML and replace it with
> > > HTML?
> > >
> > > Thanks
> > > E
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTML in response stream

Erik Hatcher
In reply to this post by Patrick Casey

On May 16, 2005, at 12:08 PM, Patrick Casey wrote:

>
>     Does anyone have any recent experience with client-side XSL
> transforms? Historically I've been nervous about trusting the  
> browsers to
> transform predictably so I've preferred server-side transforms, but  
> I might
> just be an old nervous fogey on this one.
>
>     Is it safe to trust the client to transform these days?

Depends on the client :)  Some will, some won't - it's certainly not  
ubiquitous.

     Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: HTML in response stream

Markus Eberle
In reply to this post by David Leangen
The last time i have tried using the XML transformation capabilities of the
different browsers is atleast one and a half year old, but at this point the
transformation took quite some time until the user was able to see the result.
So at this time we switched back to server-side transformation.

Cheers,
    Markus

Zitat von David Leangen <[hidden email]>:

>
> Although browsers have come a long way in terms of XML support, personally I
> wouldn't yet put my faith in that approach for at least another few years.
>
> I've tried it out casually, so to speak, and that was my conclusion. I would
> definately not do it in a production environment, but that's just me.
>
>
> Cheers,
> Dave
>
>
>
>
> > -----Original Message-----
> > From: Patrick Casey [mailto:[hidden email]]
> > Sent: 17 May 2005 01:09
> > To: 'Tapestry users'
> > Subject: RE: HTML in response stream
> >
> >
> >
> > Does anyone have any recent experience with client-side XSL
> > transforms? Historically I've been nervous about trusting the browsers to
> > transform predictably so I've preferred server-side transforms,
> > but I might
> > just be an old nervous fogey on this one.
> >
> > Is it safe to trust the client to transform these days?
> >
> > --- Pat
> >
> > > -----Original Message-----
> > > From: Robert Walker [mailto:[hidden email]]
> > > Sent: Monday, May 16, 2005 6:57 AM
> > > To: Tapestry users
> > > Subject: RE: HTML in response stream
> > >
> > > I'm not sure what the level of support is for this method, but yet
> > > another way to do this is to simply pass the XML to the client, linking
> > > in the XSL stylesheet and allowing the client to transform it.
> > >
> > > Robert
> > >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]]
> > > Sent: Sunday, May 15, 2005 4:38 PM
> > > To: Tapestry users
> > > Subject: Re: HTML in response stream
> > >
> > >
> > > There are just too many ways to do that...
> > > 1) Write a servlet filter that applies the xslt
> > >
> > > 2) Write a tapestry component that surrounds everything in your pages,
> > > override its renderComponent() and
> > >     a) make it render its body in a "buffer" (there's a renderBody()
> > > method)
> > >     b) apply xslt to the buffer
> > >     c) write the results with writer.printRaw()
> > >
> > > 3) Take a look at AbstractEngine and override something from there :)
> > > That would probably be renderResponse()
> > >
> > > Anyway, just try 1) or 2) ...
> > > And maybe there's a component like the one i descibed in Tassel
> > >
> > > > Hi all,
> > > >
> > > > I have a situtation where each component in my page is
> > > > generating XML and as a final step when they are all
> > > > finished, I need to take that and style it with an XSL
> > > > into HTML. I will then allow that HTML to go out on
> > > > the response stream. How and when do I intercept the
> > > > response stream to pull the XML and replace it with
> > > > HTML?
> > > >
> > > > Thanks
> > > > E

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTML in response stream

Andreas Andreou-4
In reply to this post by Patrick Casey
Take a look at
http://surguy.net/articles/clientside-xsl-taglib.xml
It's an article that
answers your questions and also employs this technique on itself!

Patrick Casey wrote:

> Does anyone have any recent experience with client-side XSL
>transforms? Historically I've been nervous about trusting the browsers to
>transform predictably so I've preferred server-side transforms, but I might
>just be an old nervous fogey on this one.
>
> Is it safe to trust the client to transform these days?
>
> --- Pat
>
>  
>
>>-----Original Message-----
>>From: Robert Walker [mailto:[hidden email]]
>>Sent: Monday, May 16, 2005 6:57 AM
>>To: Tapestry users
>>Subject: RE: HTML in response stream
>>
>>I'm not sure what the level of support is for this method, but yet
>>another way to do this is to simply pass the XML to the client, linking
>>in the XSL stylesheet and allowing the client to transform it.
>>
>>Robert
>>
>>-----Original Message-----
>>From: [hidden email] [mailto:[hidden email]]
>>Sent: Sunday, May 15, 2005 4:38 PM
>>To: Tapestry users
>>Subject: Re: HTML in response stream
>>
>>
>>There are just too many ways to do that...
>>1) Write a servlet filter that applies the xslt
>>
>>2) Write a tapestry component that surrounds everything in your pages,
>>override its renderComponent() and
>>    a) make it render its body in a "buffer" (there's a renderBody()
>>method)
>>    b) apply xslt to the buffer
>>    c) write the results with writer.printRaw()
>>
>>3) Take a look at AbstractEngine and override something from there :)
>>That would probably be renderResponse()
>>
>>Anyway, just try 1) or 2) ...
>>And maybe there's a component like the one i descibed in Tassel
>>
>>    
>>
>>>Hi all,
>>>
>>>I have a situtation where each component in my page is
>>>generating XML and as a final step when they are all
>>>finished, I need to take that and style it with an XSL
>>>into HTML. I will then allow that HTML to go out on
>>>the response stream. How and when do I intercept the
>>>response stream to pull the XML and replace it with
>>>HTML?
>>>
>>>Thanks
>>>E
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [hidden email]
>>For additional commands, e-mail: [hidden email]
>>    
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]