So I've made dozens of templates in lovely XHTML, and I've just found out that all their data is stored in XML. Rather than using php or other technologies to parse, because the serverside tech is rather agnostic (apart from the use of apache), I was wondering if XML can be parsed in the content area using an XSLT stylesheet without having to convert all the document to XSL? E.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Page Title</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="./assets/stylesheets/screen.css" type="text/css" media="screen" /> <script src="./assets/javascripts/library/jquery/jquery.js" type="text/javascript"></script> <script src="./assets/javascripts/global.js" type="text/javascript"></script> <!--[if lt IE 8]><link rel="stylesheet" href="./assets/stylesheets/filters/ie.css" type="text/css" media="screen" /><![endif]--> </head> <body> <div id="wrapper"> <!--#include virtual="./ssi/usercontrols.html" --> <!--#include virtual="./ssi/masthead.html" --> <!--#include virtual="./ssi/nav.html" --> <div id="main"> <div class="inner"> <div id="sidebar"> ... sidebar... </div><!--[if !IE]> sidebar <![endif]--> <div id="content"> [B]XML DATA PARSED HERE[/B] </div><!--[if !IE]> content <![endif]--> ...... Code (markup):
Doubt it. However, you're template is relatively basic so it doesn't seem it will take much effort converting them to XSL. Add this to the start of your XHTML "template": <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> Code (markup): Replace "xml data parsed here" with: <xsl:apply-templates/> Code (markup): End the file with: </xsl:template> <!-- add more templates to format XML as needed --> Code (markup): And save as file.xsl May need some modification, e.g. the content may not be the root node of your XML data, there may be some meta data such as page title to be inserted into the XHTML etc.
The template in itself is quite sophisticated. It pulls in content using SSI with conditional if statements for different sections of the site. Actually converting it so XSL would require a lot of time, even though thanks for your reply. I'm convinced there must be a way to do it! Even if it's server side using apache.