Web Hosting How-Tos
  Home arrow Web Hosting How-Tos arrow Page 5 - Building a CMS, part 2: Taking it to t...
Web Hosting Articles  
Web Hosting FAQs  
Web Hosting How-Tos  
Web Hosting News  
Web Hosting Security  
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
ASP Web Hosting  
ASP.NET Web Hosting 
Budget Hosting 
Coldfusion 
Colocation 
Mobile Linux 
APP Generation ROI 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Reseller Web Hosting 
Shared Hosting 
Small Business Hosting 
Virtual Private Servers 
Windows Web Hosting
 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB HOSTING HOW-TOS

Building a CMS, part 2: Taking it to the server
By: Chris Root
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 1
    2005-03-30

    Table of Contents:
  • Building a CMS, part 2: Taking it to the server
  • Generating the XML
  • Creating the Markup
  • A Word About Namespaces
  • PHP XSLT

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building a CMS, part 2: Taking it to the server - PHP XSLT


    (Page 5 of 5 )

    XSLT is handled by different extensions, depending upon whether you have PHP 4x or PHP 5x. For this example we will look at how it is done in PHP 4x. Consult the PHP manual at php.net for information on PHP 5.

    In our dxml.php file comment out the following line.

    header("location:".dirname($_SERVER['PHP_SELF'])."/".$f);

    The code below will process the new XML document and send it to the browser as HTML. You can provide a third parameter to xslt_process that is a file name for the result document. Whether you want to take up space with the converted documents on your server or have the server process on the fly for each request is up to you. In the absence of a third parameter we store the result in a variable, which is then echoed to the browser.

    $proc = xslt_create(); $result = xslt_process($proc,"release.xsl",$f); xslt_free($proc);
    echo($result);

    If you decide to let the server do the XSLT processing on each request, this code is what you will need for that request, with $f being the path to the XML document. Otherwise you would simply link to the HTML result document stored on the server.

    Conclusion

    We have now added server side processing to our press release generator project. The XML file that was generated could easily be transformed using additional stylesheets to other formats in an automated fashion.

    To learn more about XSLT go to the W3C website here (http://www.w3c.org/) and here (http://www.w3.org/TR/xslt). There is also an excellent XSLT reference here(http://www.zvon.org/xxl/XSLTreference/Output/) As usual, typing  XSLT in Google will lead you to more information as well.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    WEB HOSTING HOW-TOS ARTICLES

    - Choosing a Web Host for Your WordPress Blog
    - Connecting to a Server using SSH: the Fundam...
    - How to Expand a Simple Website
    - Practical Virtualization with VirtualBox
    - Other Uses for Your Web Hosting Server
    - Hosting Your Own Website: Reliability
    - Introduction to Hosting Websites
    - Choosing a Website Host
    - How to Choose a Budget Web Host
    - URL Redirection
    - How to Link a Domain Name to a Dynamic IP
    - How to Set up a Simple Website
    - Choosing the Right Kind of Web Hosting
    - Introduction to Choosing the Right Web Host
    - Strategies for Creating Domain Names






    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek