SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Professional XML with PHP

        Arne Blankerts <arne@thephp.cc>, TobiasSchlitt <toby@php.net>

                                                   IPC 2009


                                                2009-11-15




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   1 / 26
Outline




 1 Overview
          Welcome
          Overview

 2 XML


 3 XML in PHP


 4 Open part




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   2 / 26
Arne Blankerts




         Arne Blankerts <arne@thephp.cc>
         PHP since 1999 (10 years of PHP!)
         Co-Founder of thePHP.cc
         ballyhoo. werbeagentur.
         Open source addicted
                 Inventor and lead developer of fCMS site
                 system
                 Contributor and translator for the PHP manual




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   3 / 26
Tobias Schlitt



         Tobias Schlitt <toby@php.net>
         PHP since 2001
         Freelancing consultant
         Qualified IT Specialist
         Studying CS at TU Dortmund
         (finishing 2010)
         OSS addicted
                 PHP
                 eZ Components
                 PHPUnit




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   4 / 26
So, what about you?




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   5 / 26
Conferences are about contacts




          That is why both begin with con. . .
          Who are you?
          What is your business?
          What is your intention behind coming to IPC?
          What do you expect from this workshop?




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   6 / 26
What can you expect?




 Workshop                                                XPath
         Introduction to XML                                    Tuesday, 13:45 - 14:45
         Working on XML data with                               XPath in depth
         PHP                                             Validating XML
         Practical tips and tricks                              Tuesday, 15:15 - 16:15
         Interactive: What would you like                       DTD, XML Schema and
         to know?                                               RelaxNG




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP              2009-11-15   7 / 26
Rules for this workshop




         Allways Stick to your place!
         Never ask! Repeat: I will not ask anything!
         We are not here to show you anything useful!
         The only correct solution is told by us!
         Do not give feedback on http://joind.in/1041




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   8 / 26
Rules for this workshop




         Allways Stick to your place!
         Never ask! Repeat: I will not ask anything!
         We are not here to show you anything useful!
         The only correct solution is told by us!
         Do not give feedback on http://joind.in/1041




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   8 / 26
Outline




 1 Overview


 2 XML
          Overview
          Get into code. . .

 3 XML in PHP


 4 Open part




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   9 / 26
What is XML?



          General specification for creating markup languages
          Data exchange between computer systems
                  System independent
                  Human readable
                  Most used on the web
                  Successor of SGML
          W3C recommendation
                  1.0 1998 (last update 2008-11-26)
                  1.1 2004 (last update 2006-08-16)




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   10 / 26
XML languages by example



         XHTML                  XML variant of the popular HTML
                RSS             Really Simply Syndication
                                Provide news / updates / ... of websites
                                Read by special clients
                                Aggregation on portals / planets
               SVG              Scalable Vector Graphics
                                Describe vector graphics in XML
                                Potentially interactive / animated
                                (via ECMAScript)




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP      2009-11-15   11 / 26
Related technologies - Schemas

  Schema
  A schema defines the structure XML instance documents.

  XMLSchema                     Written in XML
                                W3C recommendation
                                Popular
        RelaxNG                 2 syntax variants
                                        XML based
                                        Short plain text based
                                OASIS / ISO standard
                                Popular
              DTD               Plain text
                                W3C recommendation
                                Deprecated


Arne Blankerts, Tobias Schlitt (IPC 2009)     Professional XML with PHP   2009-11-15   12 / 26
Related technologies - Querying




  Query
  A query extracts a sub-set of information from a data source.

            XPath               W3C recommendation
                                Navigation in XML documents
                                more on that later...
          XQuery                Functional programming language
                                Allows complex queries




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   13 / 26
Practical




  Let’s get into the code




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   14 / 26
Outline




 1 Overview


 2 XML


 3 XML in PHP
          DOM
          XMLReader/-Writer

 4 Open part




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   15 / 26
Overview



  XML APIs
  PHP has quite some XML APIs.

          The most important are:
                  DOM
                  XMLReader / XMLWriter
                  SimpleXML
          Deprecated are:
                  DOM XML
                  XML Parser




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   16 / 26
Overview - DOM


          Document Object Model
          Standardized API to access XML tree
                  W3C recommendation
                  Level 1 in 1999
                  Currently: Level 3 (2004)
          Available in many languages
                  C
                  Java
                  Perl
                  Python
                  ...
          Represents XML nodes as objects
          Loads full XML tree into memory



Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   17 / 26
Overview - XMLReader/-Writer




          Popular approach to access XML data
          Similar implementations available in
                  Java
                  C#
          Pull / push based
          Does not load XML fully into memory




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   18 / 26
Overview - SimpleXml




          Very simple access to XML data
          Unique (?) to PHP
          Represents XML structures as objects
          Initial implementation hackish
          Loads full XML tree into memory
          You don’t want to use SimpleXML, seriously!




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   19 / 26
APIs compared

                                            DOM       XMLReader/-Writer     SimpleXML
             Read                                                               •
             Write                                                              ◦
             Manipulate                                             •           •
             Full control                                                        -
             Namespaces                                                         ◦
             XPath                                                 -
             Validate                   DTD                     DTD             -
                                       Schema                  Schema
                                       RelaxNG                 RelaxNG
             Comfort                       •                       ◦
                         Fully supported
                     • Supported but not nice
                     ◦ Poorly supported
                      - Not supported at all



Arne Blankerts, Tobias Schlitt (IPC 2009)       Professional XML with PHP       2009-11-15   20 / 26
Practical




  Let’s get into the code




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   21 / 26
Practical




  Let’s get into the code




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   22 / 26
Outline




 1 Overview


 2 XML


 3 XML in PHP


 4 Open part




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   23 / 26
What would you like to do?




          Discuss a particular problem?
          See a special XML technique in PHP?
          Get to know related techniques?




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   24 / 26
Q/A




          Are there any questions left?
          Please give us some feedback!




Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   25 / 26
The end




          We hope you enjoyed the workshop!
          Slides and material
                  Delivered by Software & Support
                  http://schlitt.info/opensource
                  On Slideshare (http://slideshare.net)
          Contact us:
                  Arne Blankerts <arne@thephp.cc>
                  Tobias Schlitt <toby@php.net>
          Give us feedback on http://joind.in/1041

Arne Blankerts, Tobias Schlitt (IPC 2009)   Professional XML with PHP   2009-11-15   26 / 26

Mais conteúdo relacionado

Destaque (6)

XML and PHP 5
XML and PHP 5XML and PHP 5
XML and PHP 5
 
Ajax for PHP Developers
Ajax for PHP DevelopersAjax for PHP Developers
Ajax for PHP Developers
 
Ajax and PHP
Ajax and PHPAjax and PHP
Ajax and PHP
 
SQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersSQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developers
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 

Semelhante a Professional XML with PHP

Crawford ubl200212
Crawford ubl200212Crawford ubl200212
Crawford ubl200212
kcmani15
 

Semelhante a Professional XML with PHP (20)

XPath - A practical guide
XPath - A practical guideXPath - A practical guide
XPath - A practical guide
 
Validating XML - Avoiding the pain
Validating XML - Avoiding the painValidating XML - Avoiding the pain
Validating XML - Avoiding the pain
 
A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
A Technical Comparison: ISO/IEC 26300 vs Microsoft Office Open XML
 
The XML Forms Architecture
The XML Forms ArchitectureThe XML Forms Architecture
The XML Forms Architecture
 
Programming.language
Programming.languageProgramming.language
Programming.language
 
Возможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSВозможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OS
 
First Look Webcast: OneCore Storage SDK 3.6 Roll-out and Walkthrough
First Look Webcast: OneCore Storage SDK 3.6 Roll-out and WalkthroughFirst Look Webcast: OneCore Storage SDK 3.6 Roll-out and Walkthrough
First Look Webcast: OneCore Storage SDK 3.6 Roll-out and Walkthrough
 
Extending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityExtending XForms with Server-Side Functionality
Extending XForms with Server-Side Functionality
 
Catalyst 9.0
Catalyst 9.0Catalyst 9.0
Catalyst 9.0
 
IoT Studio #1: Protocols introduction and connected jukebox
IoT Studio #1: Protocols introduction and connected jukeboxIoT Studio #1: Protocols introduction and connected jukebox
IoT Studio #1: Protocols introduction and connected jukebox
 
Flink Forward San Francisco 2019: Apache Beam portability in the times of rea...
Flink Forward San Francisco 2019: Apache Beam portability in the times of rea...Flink Forward San Francisco 2019: Apache Beam portability in the times of rea...
Flink Forward San Francisco 2019: Apache Beam portability in the times of rea...
 
xml and xhtml.pptx
xml and xhtml.pptxxml and xhtml.pptx
xml and xhtml.pptx
 
Tech 802: Data, Databases & XML
Tech 802: Data, Databases & XMLTech 802: Data, Databases & XML
Tech 802: Data, Databases & XML
 
Crawford ubl200212
Crawford ubl200212Crawford ubl200212
Crawford ubl200212
 
Turbo TPF Scripting Engine - T2SE for IBM ALCS
Turbo TPF Scripting Engine - T2SE for IBM ALCSTurbo TPF Scripting Engine - T2SE for IBM ALCS
Turbo TPF Scripting Engine - T2SE for IBM ALCS
 
Introduction to Apache Beam
Introduction to Apache BeamIntroduction to Apache Beam
Introduction to Apache Beam
 
Realizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache BeamRealizing the promise of portable data processing with Apache Beam
Realizing the promise of portable data processing with Apache Beam
 
Adobe flex an overview
Adobe flex  an overviewAdobe flex  an overview
Adobe flex an overview
 
DhevendranResume
DhevendranResumeDhevendranResume
DhevendranResume
 
IETF building block in the LwM2M Ecosystem (IoT World 2017 Workshop)
IETF building block in the LwM2M Ecosystem (IoT World 2017 Workshop)IETF building block in the LwM2M Ecosystem (IoT World 2017 Workshop)
IETF building block in the LwM2M Ecosystem (IoT World 2017 Workshop)
 

Mais de Tobias Schlitt

Mais de Tobias Schlitt (6)

HTML to ODT to XML to PDF to …
HTML to ODT to XML to PDF to …HTML to ODT to XML to PDF to …
HTML to ODT to XML to PDF to …
 
Xdebug
XdebugXdebug
Xdebug
 
Unit-Tests
Unit-TestsUnit-Tests
Unit-Tests
 
Xdebug
XdebugXdebug
Xdebug
 
XML and XPath with PHP
XML and XPath with PHPXML and XPath with PHP
XML and XPath with PHP
 
WebDAV - The good, the bad and the evil
WebDAV - The good, the bad and the evilWebDAV - The good, the bad and the evil
WebDAV - The good, the bad and the evil
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Professional XML with PHP

  • 1. Professional XML with PHP Arne Blankerts <arne@thephp.cc>, TobiasSchlitt <toby@php.net> IPC 2009 2009-11-15 Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 1 / 26
  • 2. Outline 1 Overview Welcome Overview 2 XML 3 XML in PHP 4 Open part Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 2 / 26
  • 3. Arne Blankerts Arne Blankerts <arne@thephp.cc> PHP since 1999 (10 years of PHP!) Co-Founder of thePHP.cc ballyhoo. werbeagentur. Open source addicted Inventor and lead developer of fCMS site system Contributor and translator for the PHP manual Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 3 / 26
  • 4. Tobias Schlitt Tobias Schlitt <toby@php.net> PHP since 2001 Freelancing consultant Qualified IT Specialist Studying CS at TU Dortmund (finishing 2010) OSS addicted PHP eZ Components PHPUnit Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 4 / 26
  • 5. So, what about you? Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 5 / 26
  • 6. Conferences are about contacts That is why both begin with con. . . Who are you? What is your business? What is your intention behind coming to IPC? What do you expect from this workshop? Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 6 / 26
  • 7. What can you expect? Workshop XPath Introduction to XML Tuesday, 13:45 - 14:45 Working on XML data with XPath in depth PHP Validating XML Practical tips and tricks Tuesday, 15:15 - 16:15 Interactive: What would you like DTD, XML Schema and to know? RelaxNG Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 7 / 26
  • 8. Rules for this workshop Allways Stick to your place! Never ask! Repeat: I will not ask anything! We are not here to show you anything useful! The only correct solution is told by us! Do not give feedback on http://joind.in/1041 Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 8 / 26
  • 9. Rules for this workshop Allways Stick to your place! Never ask! Repeat: I will not ask anything! We are not here to show you anything useful! The only correct solution is told by us! Do not give feedback on http://joind.in/1041 Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 8 / 26
  • 10. Outline 1 Overview 2 XML Overview Get into code. . . 3 XML in PHP 4 Open part Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 9 / 26
  • 11. What is XML? General specification for creating markup languages Data exchange between computer systems System independent Human readable Most used on the web Successor of SGML W3C recommendation 1.0 1998 (last update 2008-11-26) 1.1 2004 (last update 2006-08-16) Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 10 / 26
  • 12. XML languages by example XHTML XML variant of the popular HTML RSS Really Simply Syndication Provide news / updates / ... of websites Read by special clients Aggregation on portals / planets SVG Scalable Vector Graphics Describe vector graphics in XML Potentially interactive / animated (via ECMAScript) Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 11 / 26
  • 13. Related technologies - Schemas Schema A schema defines the structure XML instance documents. XMLSchema Written in XML W3C recommendation Popular RelaxNG 2 syntax variants XML based Short plain text based OASIS / ISO standard Popular DTD Plain text W3C recommendation Deprecated Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 12 / 26
  • 14. Related technologies - Querying Query A query extracts a sub-set of information from a data source. XPath W3C recommendation Navigation in XML documents more on that later... XQuery Functional programming language Allows complex queries Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 13 / 26
  • 15. Practical Let’s get into the code Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 14 / 26
  • 16. Outline 1 Overview 2 XML 3 XML in PHP DOM XMLReader/-Writer 4 Open part Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 15 / 26
  • 17. Overview XML APIs PHP has quite some XML APIs. The most important are: DOM XMLReader / XMLWriter SimpleXML Deprecated are: DOM XML XML Parser Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 16 / 26
  • 18. Overview - DOM Document Object Model Standardized API to access XML tree W3C recommendation Level 1 in 1999 Currently: Level 3 (2004) Available in many languages C Java Perl Python ... Represents XML nodes as objects Loads full XML tree into memory Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 17 / 26
  • 19. Overview - XMLReader/-Writer Popular approach to access XML data Similar implementations available in Java C# Pull / push based Does not load XML fully into memory Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 18 / 26
  • 20. Overview - SimpleXml Very simple access to XML data Unique (?) to PHP Represents XML structures as objects Initial implementation hackish Loads full XML tree into memory You don’t want to use SimpleXML, seriously! Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 19 / 26
  • 21. APIs compared DOM XMLReader/-Writer SimpleXML Read • Write ◦ Manipulate • • Full control - Namespaces ◦ XPath - Validate DTD DTD - Schema Schema RelaxNG RelaxNG Comfort • ◦ Fully supported • Supported but not nice ◦ Poorly supported - Not supported at all Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 20 / 26
  • 22. Practical Let’s get into the code Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 21 / 26
  • 23. Practical Let’s get into the code Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 22 / 26
  • 24. Outline 1 Overview 2 XML 3 XML in PHP 4 Open part Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 23 / 26
  • 25. What would you like to do? Discuss a particular problem? See a special XML technique in PHP? Get to know related techniques? Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 24 / 26
  • 26. Q/A Are there any questions left? Please give us some feedback! Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 25 / 26
  • 27. The end We hope you enjoyed the workshop! Slides and material Delivered by Software & Support http://schlitt.info/opensource On Slideshare (http://slideshare.net) Contact us: Arne Blankerts <arne@thephp.cc> Tobias Schlitt <toby@php.net> Give us feedback on http://joind.in/1041 Arne Blankerts, Tobias Schlitt (IPC 2009) Professional XML with PHP 2009-11-15 26 / 26