SlideShare a Scribd company logo
1 of 16
A Sneak Preview of  XML in PHP 5 Adam Trachtenberg Co-Author  PHP Cookbook [email_address] January 21, 2004
XML Extensions in PHP 5 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Five Major Extensions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Music Catalogue XML ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DOM ,[object Object],[object Object],[object Object],[object Object]
DOM Example Code $music  = new  domDocument ; $music -> preserveWhiteSpace  =  false ; $music -> load ( 'music.xml' ); $names  =  $music ->      getElementsByTagName ( 'name' ); foreach ( $names  as  $name ) {    print  $name -> firstChild     -> nodeValue ; } The Rolling Stones Aimee Mann
SAX ,[object Object],[object Object],[object Object],[object Object]
SimpleXML ,[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleXML Example Code $x  =  simplexml_load_string ( $xml ); $artists  =  $x -> artist ; foreach( $artists  as  $artist ) {      print  "$artist->name" ; } The Rolling Stones Aimee Mann
XPath ,[object Object],[object Object],[object Object]
XPath Example Code ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
XSLT ,[object Object],[object Object],[object Object],[object Object]
XSLT Example Code ,[object Object],[object Object],[object Object],[object Object],[object Object]
Web Services ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Resources ,[object Object],[object Object],[object Object],[object Object]
Did I mention I wrote a book?

More Related Content

What's hot

Extensible Stylesheet Language
Extensible Stylesheet LanguageExtensible Stylesheet Language
Extensible Stylesheet Language
Jussi Pohjolainen
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlagging
Suite Solutions
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
Suite Solutions
 
LocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputsLocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputs
Suite Solutions
 

What's hot (20)

Extensible Stylesheet Language
Extensible Stylesheet LanguageExtensible Stylesheet Language
Extensible Stylesheet Language
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
PDF Localization
PDF  LocalizationPDF  Localization
PDF Localization
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlagging
 
Xml
XmlXml
Xml
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
 
XML and DTD
XML and DTDXML and DTD
XML and DTD
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Ot performance webinar
Ot performance webinarOt performance webinar
Ot performance webinar
 
AdvancedXPath
AdvancedXPathAdvancedXPath
AdvancedXPath
 
XMLT
XMLTXMLT
XMLT
 
XML XSLT
XML XSLTXML XSLT
XML XSLT
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamud
 
Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
 
XML and XSLT
XML and XSLTXML and XSLT
XML and XSLT
 
Python xml processing
Python   xml processingPython   xml processing
Python xml processing
 
LocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputsLocalizingStyleSheetsForHTMLOutputs
LocalizingStyleSheetsForHTMLOutputs
 
Xslt
XsltXslt
Xslt
 
XML
XMLXML
XML
 

Viewers also liked

Viewers also liked (12)

Object oriented mysqli connection function
Object oriented mysqli connection functionObject oriented mysqli connection function
Object oriented mysqli connection function
 
PHP 5 + MySQL 5 = A Perfect 10
PHP 5 + MySQL 5 = A Perfect 10PHP 5 + MySQL 5 = A Perfect 10
PHP 5 + MySQL 5 = A Perfect 10
 
Pengantar Pemrograman WEB PHP
Pengantar Pemrograman WEB PHPPengantar Pemrograman WEB PHP
Pengantar Pemrograman WEB PHP
 
Escenario Vitivinícola 2007
Escenario Vitivinícola 2007Escenario Vitivinícola 2007
Escenario Vitivinícola 2007
 
Web 2.0 Introduction
Web 2.0 IntroductionWeb 2.0 Introduction
Web 2.0 Introduction
 
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionDirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP Extension
 
NoSQL! is it for you?
NoSQL! is it for you?NoSQL! is it for you?
NoSQL! is it for you?
 
Modul dasar pemrograman web
Modul dasar pemrograman webModul dasar pemrograman web
Modul dasar pemrograman web
 
PEAR For The Masses
PEAR For The MassesPEAR For The Masses
PEAR For The Masses
 
How To Install Apache, MySQL & PHP on Windows Vista
How To Install Apache, MySQL & PHP on Windows VistaHow To Install Apache, MySQL & PHP on Windows Vista
How To Install Apache, MySQL & PHP on Windows Vista
 
XML-Socket-Server zur Kommunikation mit Flash
XML-Socket-Server zur Kommunikation mit FlashXML-Socket-Server zur Kommunikation mit Flash
XML-Socket-Server zur Kommunikation mit Flash
 
No Sql Introduction
No Sql IntroductionNo Sql Introduction
No Sql Introduction
 

Similar to XML and PHP 5

XML processing with perl
XML processing with perlXML processing with perl
XML processing with perl
Joe Jiang
 
Jsonsaga
JsonsagaJsonsaga
Jsonsaga
nohmad
 
Douglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation JsonsagaDouglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation Jsonsaga
Ajax Experience 2009
 
Xml For Dummies Chapter 12 Handling Transformations With Xsl it-slideshares...
Xml For Dummies   Chapter 12 Handling Transformations With Xsl it-slideshares...Xml For Dummies   Chapter 12 Handling Transformations With Xsl it-slideshares...
Xml For Dummies Chapter 12 Handling Transformations With Xsl it-slideshares...
phanleson
 

Similar to XML and PHP 5 (20)

XML processing with perl
XML processing with perlXML processing with perl
XML processing with perl
 
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
 
Xml
XmlXml
Xml
 
The JSON Saga
The JSON SagaThe JSON Saga
The JSON Saga
 
Jsonsaga
JsonsagaJsonsaga
Jsonsaga
 
Xml Overview
Xml OverviewXml Overview
Xml Overview
 
Douglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation JsonsagaDouglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation Jsonsaga
 
XML Tools for Perl
XML Tools for PerlXML Tools for Perl
XML Tools for Perl
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
5 xsl (formatting xml documents)
5   xsl (formatting xml documents)5   xsl (formatting xml documents)
5 xsl (formatting xml documents)
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate Works
 
Xml For Dummies Chapter 12 Handling Transformations With Xsl it-slideshares...
Xml For Dummies   Chapter 12 Handling Transformations With Xsl it-slideshares...Xml For Dummies   Chapter 12 Handling Transformations With Xsl it-slideshares...
Xml For Dummies Chapter 12 Handling Transformations With Xsl it-slideshares...
 
XML Bible
XML BibleXML Bible
XML Bible
 
Week 12 xml and xsl
Week 12 xml and xslWeek 12 xml and xsl
Week 12 xml and xsl
 
Xmlphp
XmlphpXmlphp
Xmlphp
 
Xml
XmlXml
Xml
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
 
DOM and SAX
DOM and SAXDOM and SAX
DOM and SAX
 
Sakai09 Osp Preconference Afternoon Forms
Sakai09 Osp Preconference Afternoon FormsSakai09 Osp Preconference Afternoon Forms
Sakai09 Osp Preconference Afternoon Forms
 
Xml Schema
Xml SchemaXml Schema
Xml Schema
 

XML and PHP 5

  • 1. A Sneak Preview of XML in PHP 5 Adam Trachtenberg Co-Author PHP Cookbook [email_address] January 21, 2004
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. DOM Example Code $music = new domDocument ; $music -> preserveWhiteSpace = false ; $music -> load ( 'music.xml' ); $names = $music ->      getElementsByTagName ( 'name' ); foreach ( $names as $name ) {    print $name -> firstChild -> nodeValue ; } The Rolling Stones Aimee Mann
  • 7.
  • 8.
  • 9. SimpleXML Example Code $x = simplexml_load_string ( $xml ); $artists = $x -> artist ; foreach( $artists as $artist ) {      print "$artist->name" ; } The Rolling Stones Aimee Mann
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Did I mention I wrote a book?