Miscellaneous

  Home arrow Miscellaneous arrow Page 4 - Transforming XML with XSLT and PHP
MISCELLANEOUS

Transforming XML with XSLT and PHP
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 12
    2003-10-12

    Table of Contents:
  • Transforming XML with XSLT and PHP
  • The XML Document
  • The XSLT Template
  • Transforming the Document
  • Conclusion

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Transforming XML with XSLT and PHP - Transforming the Document


    (Page 4 of 5 )

    Using the XSLT Parser is simple and straight forward. The parser is created, the XML document and XSLT stylesheet is passed to it and the transformed document is returned.

    <?php
      $parser = xslt_create();
      $html = xslt_process($parser, "exampleDocument.xml",
              "exampleTemplate.xsl");
      xslt_free($parser);

      echo $html;
    ?>

    .First, an XSLT parser object is created to transform the XML document using the function xslt_create which returns a handle to the parser. The xslt_process function accepts the parser handle, the XML document and the XSLT document. It applies the template rules and returns the transformed version of the XML document. Finally, the system resources used for the parser are destroyed by using the xslt_free function.

    More Miscellaneous Articles
    More By bluephoenix

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


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