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 Reviews  
Web Hosting Security  
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
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
     
     

    SEARCH WEB HOSTERS

    TOOLS YOU CAN USE

    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

    - Phishing Scams: An Overview and How to Detec...
    - Tips for Safe Downloading Online
    - How To Avoid Spam
    - How to Get Into Ethical Hacking
    - How to Prevent Drive-by Downloads
    - Facebook Timeline Tips and Tricks
    - How to Keep Up with Facebook`s Changes
    - Wi-Fi Network Security Tips
    - Tips for Safe Online Holiday Shopping
    - Facebook Privacy: Keeping Up with the Const...
    - Tips for Facebook Privacy
    - How to Cover Your Tracks on the Web
    - SSH Keys for FileZilla and Putty in Cpanel
    - How to Create a Filezilla FTP User
    - How to Install FileZilla Server

    Developer Shed Affiliates

     




    © 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap