Welcome Guest, Not a member yet? Register   Sign In
XSLT views
#1

[eluser]moesian[/eluser]
Hi,

Is anyone here using xslt to create their views?

Is client-side xslt creation of pages a viable option or is the xslt best peformed serverside? (I'm only really interested in a site working for current browsers and ie6)

The idea of being able to transform an xml document to create pages for specific devices using different xsl files sounds appealing, but are there issues I should be aware of? (Speed, extra processing)

Thanks
#2

[eluser]al042077[/eluser]
I'm no expert, but I'd say to do the processing on the server side rather than depending on the client. Perhaps you could merge with an XSL template according to the user agent - one for PC browser, one for mobile phone, and maybe one for just text.

I thought about this early on, too, but it felt redundant of the views. You'd be creating a separate XSL template for each user agent anyways, why not just create separate view file and be done. Perhaps develop a naming scheme such as:
Quote:browser_my_home.php
mobile_my_home.php
text_my_home.php
Then call the view with a variable (setup earlier as shown in the example at http://ellislab.com/codeigniter/user-gui...agent.html):
Code:
$this->load->view($agent.'_my_home');
I'm not certain, but I'd guess this is faster as it wouldn't require processing of the XML/XSL.




Theme © iAndrew 2016 - Forum software by © MyBB