# \[OT\] Inject XML into page and tranform with XSL

**URL:** <https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046>\
**Category:** Rails\
**Created:** [May 1, 2007, 5:57am UTC](https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046 "2007-05-01T05:57:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [May 1, 2007, 5:57am UTC](https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046/1 "2007-05-01T05:57:24Z")

</div>

Hi,

Is it possible to recieve an xml repsonse from my rails app, and then,  
client side, inject the xml into the page without reloading and have it  
apply an xslt? Like an AJAX call, but ajax is unavailable to me.

My very limited understanding suggests that xslt is only done at run  
time in  
safari at least.

If I can’t get thsi to work the other option I’ve thought of is to use  
Javascript to transform the xml in very predetermined ways. This  
doesn’t  
appeal to me though.

Anyone have any pointers?

Cheers  
Daniel

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [May 1, 2007, 9:15am UTC](https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046/2 "2007-05-01T09:15:32Z")

</div>

Yes, it is possible.

Joshua

Daniel ----- wrote:

> Hi,
> 
> Is it possible to recieve an xml repsonse from my rails app, and then,  
> client side, inject the xml into the page without reloading and have it  
> apply an xslt? Like an AJAX call, but ajax is unavailable to me.
> 
> My very limited understanding suggests that xslt is only done at run  
> time in  
> safari at least.
> 
> If I can’t get thsi to work the other option I’ve thought of is to use  
> Javascript to transform the xml in very predetermined ways. This  
> doesn’t  
> appeal to me though.
> 
> Anyone have any pointers?
> 
> Cheers  
> Daniel

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [May 1, 2007, 1:38pm UTC](https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046/3 "2007-05-01T13:38:52Z")

</div>

On 4/30/07, Daniel N [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Javascript to transform the xml in very predetermined ways. This doesn’t  
> appeal to me though.
> 
> Anyone have any pointers?

I wouldn’t rely on xsl being available in your client’s browsers,  
unless you control what browser they run (in a corporation perhaps).

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [May 2, 2007, 1:51am UTC](https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046/4 "2007-05-02T01:51:15Z")

</div>

On 5/2/07, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Why not server-side? Could you have an after\_filter that runs the xml  
> through Xalan or something - we’ve used that successfully (although it  
> was just a vanilla page load - not ajax)
> 
> Fred
> 
> –

That would be nice if I could do it server side, but then I would just  
use  
normal views and not worry about the xml at all.

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [May 1, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046/5 "2007-05-01T18:45:59Z")

</div>

Why not server-side? Could you have an after\_filter that runs the xml  
through Xalan or something - we’ve used that successfully (although it  
was just a vanilla page load - not ajax)

Fred

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [May 2, 2007, 1:52am UTC](https://www.ruby-forum.com/t/ot-inject-xml-into-page-and-tranform-with-xsl/103046/6 "2007-05-02T01:52:16Z")

</div>

On 5/1/07, Rick O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I wouldn’t rely on xsl being available in your client’s browsers,  
> unless you control what browser they run (in a corporation perhaps).
> 
> –

I had a feeling that would be the case. Oh well. Looks like I’ll have  
to  
come at it differently.

Thanx
