XML Transformations with PHP

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites

    XML Transformations with PHP - Presentation Transcript

    1. XML Transformations with PHP Sebastian Bergmann <http://www.sebastian-bergmann.de/> International PHP Conference 2003 – Spring Edition Amsterdam, May, 9 th 2003
    2. Please bear with me ...
      • Maybe I should begin this presentation with: „ My written English is better than my spoken English. “.
      • This is the second time (the first time was only some hours ago) I give a presentation in English. Please bear with me ;-)
      • Feel free to ask questions at any time!
    3. Why transform XML?
      • Transforming XML documents from one format to another becomes more and more important.
      • In a Content Management System (CMS) setting custom additions to XHTML like <navigation/> allow designers to work with tools they are familar with: tags.
      • Such a tag would trigger a functionality implemented by a programmer; the designer does not need to know how the tag produces its output.
    4. Why not use XSLT?
      • XSLT is a domain specific language for transforming XML documents into other XML documents.
      • XSLT transforms XML trees like awk transforms document lines. Both languages have a strict condition-action syntax.
      • XSLT programs are written in XML syntax. This makes for a very verbose syntax.
    5. Why not use XSLT?
    6. Why not use XSLT?
      • XSLT is a Functional Programming language.
      • This would not present a problem if you were able to leverage the potential of functional programming.
      • But XSLT only ''provides'' the programmer with the drawbacks of functional programming – like using recursion to express loops – while omitting its benefits. For instance the use of functions as data types is not possible in XSLT.
    7. Solving problems with the XML Transformer
      • The XML Transformer provides an elegant solution to '' bring PHP objects to the web ''.
      • It allows the PHP programmer to describe the transformations from one XML format to another using his favourite programming language: PHP.
    8. Installing the XML Transformer
      • The XML Transformer is a PEAR ( PHP Extension and Application Repository ) package.
      • It is hosted at http://pear.php.net/ and can easily be installed using the PEAR Installer.
    9. A First Example
    10. Using the Output Buffer Driver
    11. Bundled Namespace Handlers: Anchor
    12. Bundled Namespace Handlers: Image
    13. Bundled Namespace Handlers: PHP
    14. Writing Namespace Handlers
      • Inherit a class from the XML_Transformer_Namespace class.
      • For each element that is to be transformed write a start_ELEMENT($attributes) and a end_ELEMENT($cdata) method.
      • The XML Transformer will call these methods for the opening and closing tags of the ELEMENT.
    15.  
    16. XML_Transformer_Util::attributesToString()
    17. XML_Transformer_Util::qualifiedElement()
    18. Debugging the XML Transformer
      • The XML Transformer provides a Debugging Mode.
      • When enabled, for each event a debug message is sent to either the screen or to a logfile.
    19. XML Transformer Error Handling
      • The XML Transformer tries to provide useful error messages.
      • An error occurs, for instance, when a transformation methods returns a string that is not well-formed XML.
    20. Deploying XML Transformer Efficiently
      • Leveraging Apache's .htaccess and PHP's auto_prepend_file mechanisms we will now discuss an efficient deployment strategy for XML Transformer driven applications.
    21. Deploying XML Transformer Efficiently

    + Sebastian BergmannSebastian Bergmann, 4 years ago

    custom

    2127 views, 2 favs, 0 embeds more stats

    More info about this document

    CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

    Go to text version

    • Total Views 2127
      • 2127 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories