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

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

XPath - A practical guide
XPath - A practical guideXPath - A practical guide
XPath - A practical guideTobias Schlitt
 
Validating XML - Avoiding the pain
Validating XML - Avoiding the painValidating XML - Avoiding the pain
Validating XML - Avoiding the painTobias Schlitt
 
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 Alexandro Colorado
 
The XML Forms Architecture
The XML Forms ArchitectureThe XML Forms Architecture
The XML Forms ArchitectureiText Group nv
 
Возможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSВозможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSCisco Russia
 
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 WalkthroughEmulex Corporation
 
Extending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityExtending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityMarkku Laine
 
Catalyst 9.0
Catalyst 9.0Catalyst 9.0
Catalyst 9.0Shamusd
 
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 jukeboxMickaël Rémond
 
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...Flink Forward
 
xml and xhtml.pptx
xml and xhtml.pptxxml and xhtml.pptx
xml and xhtml.pptxssusere16bd9
 
Tech 802: Data, Databases & XML
Tech 802: Data, Databases & XMLTech 802: Data, Databases & XML
Tech 802: Data, Databases & XMLsomisguided
 
Crawford ubl200212
Crawford ubl200212Crawford ubl200212
Crawford ubl200212kcmani15
 
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 ALCSNajmi Mansoor Ahmed
 
Introduction to Apache Beam
Introduction to Apache BeamIntroduction to Apache Beam
Introduction to Apache BeamKnoldus Inc.
 
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 BeamDataWorks Summit
 
Adobe flex an overview
Adobe flex  an overviewAdobe flex  an overview
Adobe flex an overviewSubin Sugunan
 
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)Open Mobile Alliance
 

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

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 educationjfdjdjcjdnsjd
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Último (20)

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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

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