# Browser Processing of XSL

**URL:** <https://forum.kirupa.com/t/browser-processing-of-xsl/259283>\
**Category:** web dev\
**Created:** [May 2, 2008, 7:47pm UTC](https://forum.kirupa.com/t/browser-processing-of-xsl/259283 "2008-05-02T19:47:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmj134](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@rmj134](https://forum.kirupa.com/u/rmj134)\
**Post date:** [May 2, 2008, 7:47pm UTC](https://forum.kirupa.com/t/browser-processing-of-xsl/259283/1 "2008-05-02T19:47:10Z")

</div>

At best, someone has an answer, but I imagine that a discussion on the topic could be helpful also.

Basically (for those not familiar with XSL), when a current browser loads an XML file ([www.mysite.com/xmldata.xml](http://www.mysite.com/xmldata.xml)), and the XML file has a link to an XSL file, the browser will process the XSL file, but the source will still show the original XML. Based on a blog post I found, someone used this to load Flash on a presentation layer via XSL, but have XML in the source. It seems until this is abused, and the XML is formatted similarly to HTML, this is a viable way for RIA developers to have their content indexed by search engines.

This is great and all for an all Flash site (because there is a relatively small amount of HTML required to display Flash), but I am trying to find a solution for hybrid sites or “Progressive Enhancement” sites. Technically, I could start building all my hybrid sites in XSL files instead of HTML, but I don’t really want to do that.

I have tried a few different solutions to no avail. I have tried using php’s libxslt, but the translation is done on the server, and therefore the source shows the translated HTML, not the XML I am looking for (I imagine this would be the case for any server-side processing). I also tried JavaScript and AJAX, looking for a client-side approach, but that shows the HTML instead of the XML also. I have also tried outputting XML with the XSL link as a string, but it seems browsers will only process the style sheet if the file extension is .XML. The only solution I have found is to use an iframe to handle the XSLT processed XML and have HTML in the containing page. I have read that search engine bots will index the iframe source if not blocked, but the problem is that it is indexed as a separate page (duh!), not part of containing file (what I want).

Does anyone have a solution, or even a suggestion? I hope this wasnt too drawn out or confusing.
