This document summarizes an XML for PHP Developers presentation. The presentation introduces XML basics and parsers in PHP like simplexml, DOM, SAX and XMLReader. It provides recipes for parsing an RSS feed to retrieve weather data, generating an Atom feed using DOM, and scraping member data from a government website. The presentation aims to help attendees start using XML with PHP through practical examples and resources.
Session Server - Maintaing State between several ServersStephan Schmidt
This document summarizes maintaining state between servers using a session server. It discusses the need for sessions in stateless HTTP, limitations of built-in PHP sessions, and how a central session server addresses these issues. It then covers building a session server in PHP using sockets and processes (PCNTL), and implementing a full-featured session server using the Net_Server and HTTP_SessionServer classes along with a client library.
This document discusses file operations in C++. It defines what a file is and describes basic file operations like opening, writing, reading, and closing files. It explains how to set up a C++ program for file input/output by including the fstream header. Different stream objects like ifstream, ofstream, and fstream are used to represent input/output from files. The document also covers opening files, checking for open errors, writing and reading data from files using insertion and extraction operators, formatting file output, detecting the end of a file, and using getline() and put() functions for character I/O.
This document provides an overview of Apache Solr, an open source search platform based on Lucene. It discusses how Solr works, including indexing documents, defining schemas, querying the index via HTTP requests, and returning results in XML or JSON format. The document also provides examples of queries, updating the index, and customizing the analyzer for Thai language support.
This document provides an overview of software architectures for semantic web applications, including local access, mixed access, and remote access architectures. Local access architectures involve storing and querying RDF data locally using a triplestore and API. Remote access architectures involve querying RDF data owned by a third party using the SPARQL Protocol over HTTP or SOAP. The SPARQL Protocol is an abstract specification for remotely executing SPARQL queries in a standards-based way.
Quick beginner to Lower-Advanced guide/tutorial in PHPSanju Sony Kurian
A Quick beginner to Lower-Advanced tutorial in PHP. Prepared for a session at MEA Perinthalmanna. Covers basic tutorials and concepts and covers some advanced topics.
The document discusses file input/output (IO) in Java. It covers key concepts like streams, files, the File class, and IO classes. The File class represents file and directory pathnames and is used to get file information. Streams are used for IO and can be byte-based or character-based. The File class has methods for renaming, deleting, and getting attributes of files. Sample programs demonstrate using the File class to rename and delete files. The document also outlines the main abstract stream classes in Java for input, output, readers and writers.
This document discusses input/output (I/O) in Java. It covers handling files and directories using the File class, understanding character-based and byte-based streams, and examples of character and binary file input/output. Character I/O uses Readers and Writers, while binary I/O uses DataStreams. A BufferedReader is required to read full lines of text from a file. Formatting output is handled using DecimalFormat since Java has no printf method. Streams can be chained together, such as a FileOutputStream chained to a DataOutputStream for binary file output.
The document discusses various methods for reading and writing files in PHP, including opening and reading a file, alternative methods like file() and file_get_contents(), including files using include() and require(), and writing to files using functions like fwrite() and file_put_contents(). It provides examples of opening, reading, and writing files, including files, and checking if a file exists.
Session Server - Maintaing State between several ServersStephan Schmidt
This document summarizes maintaining state between servers using a session server. It discusses the need for sessions in stateless HTTP, limitations of built-in PHP sessions, and how a central session server addresses these issues. It then covers building a session server in PHP using sockets and processes (PCNTL), and implementing a full-featured session server using the Net_Server and HTTP_SessionServer classes along with a client library.
This document discusses file operations in C++. It defines what a file is and describes basic file operations like opening, writing, reading, and closing files. It explains how to set up a C++ program for file input/output by including the fstream header. Different stream objects like ifstream, ofstream, and fstream are used to represent input/output from files. The document also covers opening files, checking for open errors, writing and reading data from files using insertion and extraction operators, formatting file output, detecting the end of a file, and using getline() and put() functions for character I/O.
This document provides an overview of Apache Solr, an open source search platform based on Lucene. It discusses how Solr works, including indexing documents, defining schemas, querying the index via HTTP requests, and returning results in XML or JSON format. The document also provides examples of queries, updating the index, and customizing the analyzer for Thai language support.
This document provides an overview of software architectures for semantic web applications, including local access, mixed access, and remote access architectures. Local access architectures involve storing and querying RDF data locally using a triplestore and API. Remote access architectures involve querying RDF data owned by a third party using the SPARQL Protocol over HTTP or SOAP. The SPARQL Protocol is an abstract specification for remotely executing SPARQL queries in a standards-based way.
Quick beginner to Lower-Advanced guide/tutorial in PHPSanju Sony Kurian
A Quick beginner to Lower-Advanced tutorial in PHP. Prepared for a session at MEA Perinthalmanna. Covers basic tutorials and concepts and covers some advanced topics.
The document discusses file input/output (IO) in Java. It covers key concepts like streams, files, the File class, and IO classes. The File class represents file and directory pathnames and is used to get file information. Streams are used for IO and can be byte-based or character-based. The File class has methods for renaming, deleting, and getting attributes of files. Sample programs demonstrate using the File class to rename and delete files. The document also outlines the main abstract stream classes in Java for input, output, readers and writers.
This document discusses input/output (I/O) in Java. It covers handling files and directories using the File class, understanding character-based and byte-based streams, and examples of character and binary file input/output. Character I/O uses Readers and Writers, while binary I/O uses DataStreams. A BufferedReader is required to read full lines of text from a file. Formatting output is handled using DecimalFormat since Java has no printf method. Streams can be chained together, such as a FileOutputStream chained to a DataOutputStream for binary file output.
The document discusses various methods for reading and writing files in PHP, including opening and reading a file, alternative methods like file() and file_get_contents(), including files using include() and require(), and writing to files using functions like fwrite() and file_put_contents(). It provides examples of opening, reading, and writing files, including files, and checking if a file exists.
XML is a standard for storing and transporting data. It allows data to be self-describing and easy to exchange between systems. XML documents must be well-formed, following rules like having matching tags and attributes in quotes. XML uses elements to represent data and attributes to represent metadata. Namespaces allow distinguishing between identically named elements from different domains. XML is processed by parsers like SAX, DOM, and StAX. XSLT uses XPath to transform XML documents into other formats like HTML.
The document discusses various topics related to web development including:
1. An overview of HTML, the language used to design web pages.
2. How to write basic HTML code using tags like <html>, <head>, <body>.
3. Common HTML elements for text formatting, links, images, and lists.
4. How attributes provide additional information for elements.
This document summarizes key aspects of XML including:
- XML is a text-based format for describing data structures that is both human and machine readable.
- XML became a W3C standard in 1998 and is commonly used for exchanging data between disparate systems.
- Java can be used to generate, access, format, parse, validate, and transform XML data.
- XML documents have a root element containing other nested elements and attributes to describe hierarchical data.
- Well-formed XML documents follow syntax rules for proper nesting of start/end tags and quotes around attribute values.
- XML parsers like SAX and DOM are used to read XML documents sequentially or build a navigable tree structure in memory
This document discusses how XML can be integrated into business applications. It provides examples of using XML to store and transfer data between different platforms and applications. It also discusses techniques for generating XML from databases and components using ADO and custom XML generators in VB.
This document discusses how XML can be integrated into business applications. It provides examples of using XML to store and transfer data between different platforms and applications. It also discusses techniques for generating XML from databases and components using ADO and custom XML generators in VB.
This document discusses how XML can be integrated into business applications. It provides examples of using XML to store and transfer data between different platforms and applications. It also discusses techniques for generating XML from databases and components using ADO and custom XML generators in VB.
This document discusses XML validation using an XML schema (XSD) file. It provides an example of using an XmlReader with validation enabled to validate an XML file against an XSD schema. The example loads an XML file, validates it using a schema at a given URI, and handles any validation errors, displaying status messages. It demonstrates how to automatically generate an XSD from an XML file in Visual Studio to define the XML structure.
The document discusses different XML parsers in Java including DOM, SAX, and StAX. DOM represents the XML document as an in-memory tree which allows flexible processing but uses more memory. SAX is event-driven and reads the XML sequentially using less memory. StAX is similar to SAX but simplified and "pull"-based where the developer manually navigates elements. The document also covers using JAXP for XML processing independence and the key classes involved in DOM and StAX parsing.
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeMarco Gralike
This document summarizes key concepts and capabilities of Oracle XML DB including:
1. The Protocol Server which handles XML storage and access via HTTP, FTP, and WebDAV. Its configuration involves files like listener.ora and xdbconfig.xml.
2. Various HTTP APIs for XML DB access like PL/SQL gateways, native database web services (NDWS), and the DBUri servlet for browsing database data.
3. URITypes for representing URIs that target database data (DBUriType), URLs outside the database (HTTPUriType), and resources in the XML DB repository (XDBUriType).
4. Combining XML DB with capabilities like BFILE to select and
This document provides an overview of XML documents and vocabularies. It discusses the structure of an XML document, including the document prolog section containing the XML declaration and document type declaration. It describes document elements as the building blocks of an XML document. It also explains XML declarations, namespaces, and DTDs (document type definitions). XML namespaces help avoid element name conflicts, and DTDs define rules to check the vocabulary and structure of XML documents. The document gives examples of internal and external DTDs.
This document summarizes Masahiro Nakagawa's presentation on Fluentd and Embulk. Fluentd is a data collector for unified logging that allows for streaming data transfer based on JSON. It is written in Ruby and uses plugins to collect, process, and output data. Embulk is a bulk loading tool that allows high performance parallel processing of data to load it into various databases and storage systems. Both tools use a pluggable architecture to provide flexibility in handling different data sources and targets.
Today’s web and mobile app localization industry relies on numerous standards, libraries and file formats to facilitate the exchange between developers and translators. While some formats are somewhat sophisticated, others lack even the most basic features, like pluralization and contextualization. And most can’t offer support for more advanced localization features, like language cases.
The most common localization formats include Gettext PO, PHP Arrays, Android XML, YAML, .Net RESX, iOS Strings and many others. A typical developer today works with many frameworks - for instance a Laravel backend app (PHP Arrays) with Ember front end (i18n JS) and iOS mobile app (Strings). Since all standards have distinct syntax, in many cases translations cannot be shared across applications.
Translation Markup Language (TML) aims to solve both these problems by introducing a powerful extensible cross-platform syntax that offers support for pluralization, language contextualization, language cases, reusable decorators and much more. TML libraries are available for all major web and mobile platforms. TML allows translators to do in-context translations - where they can translate right from within the apps. TML libraries also eliminate the need for developers to ever deal with the resource files, as all extractions and translation substitution is done realtime and the resource files are only used as a transport between the apps and the Translation Exchange platform.
Translation Exchange stores all translations in Universal Translation Memory (UTM), a graph database which stores all translations with their context, tone, rank and other attributes for accurate matching. This allows translations to be shared across all apps in the Translation Exchange Network. The translation memories of each app are extracted from the UTM graph and are managed by their individual localization teams. During this presentation we will look at some of the features of TML and how it can be used to quickly translate a Laravel application into any number of languages using in-context translation tools. We will also look at how the data is stored and shared across applications using UTM.
This is an introduction to web apps aimed at people without a tech background but who want to learn more about technology, e.g. people in business, sales or non-tech startup founders. It's an overview of how modern web applications are implemented, covering things like architecture, HTML, Javascript, server-side programming languages and a bit of history as well.
XML is everywhere. Computers, Mobiles, Bank Systems, Internet, TVs, Microwaves, all use XML as an Information Wrapping and Information Xchange System. We will tell you all the basics in a simplest possible way.
XML presentation discusses XML (Extensible Markup Language). It describes XML as a text-based markup language derived from SGML that is extensible and carries data without presenting it. The document provides examples of XML documents and elements like articles, authors, titles, and text. It also discusses XML syntax rules, namespaces to avoid element name conflicts, and the importance of XML for data transfer, configuration files, schemas/templates, and more. Querying XML data with XPath and XQuery is also introduced.
The document discusses microformats, which are a way to add semantics to web pages by using HTML and CSS classes to encode structured data about calendar events, contacts, reviews and other types of information. Microformats leverage existing web standards like HTML and CSS to make machine-readable data human-readable as well, by displaying it naturally on web pages. The paper evaluates how microformats are a successful approach to introducing semantics to web pages using pre-existing standards in a way that is compatible with both humans and machines.
Our CTO, Angel Gruev came up with quick Introduction to XML Technologies. (XML) is a markup language that defines a set of rules for encoding documents in a format which is both human-readable and machine-readable. It is defined by the W3C's XML 1.0 Specification and by several other related specifications, all of which are free open standards.
Esoft Metro Campus - Diploma in Web Engineering - (Module III) Coding HTML for Basic Web Designing
(Template - Virtusa Corporate)
Contents:
Introduction to HTML
HTML Versions
HTML Standards
Creating a Simple HTML Document
Document Type Declaration
Comments in HTML
HTML Attributes
Paragraphs
Line Break
Headings
Text Formatting
Font Formatting
Images
Hyperlinks
Page Body
Lists
Tables
Cell Merging in a Table
Table Attributes
Horizontal Rule
Iframes
HTML Blocks
Division
Span
Audio
Video
Youtube Videos
Forms and Input
Introduction to CSS
Advantages of Using CSS
CSS Syntax
CSS Comments
How to Insert CSS?
CSS Tag, ID and Class Selectors
Grouping and Nesting Selectors
CSS Backgrounds
CSS Text
CSS Fonts
CSS Links
CSS Lists
CSS Tables
CSS Box Model
CSS Dimension
CSS Display - Block and Inline
CSS Positioning
CSS Float
CSS Alignment
Navigation Menu in CSS
This document provides an overview and introduction to XML (eXtensible Markup Language). It discusses the basic rules of XML, parsing XML, XML namespaces, XML schemas, XSLT transformations, and examples of where XML is applied such as web design, web services, mobile web, and content authoring.
This document discusses PowerShell formatting and summarization techniques. It reviews default formatting, composite formatting strings, formatting with Format-Table and Format-List, and using formatting XML. It also demonstrates formatting strings, hash tables for formatting, and using a module called EasyOutput to simplify complex formatting tasks.
The document discusses best practices for sending bulk emails using PHP including using libraries like Zend_Mail and Swiftmailer, setting proper headers and authentication, managing opt-in subscriber lists, handling unsubscribes, and avoiding blacklisting. It also provides tips for identity and branding, list management, bounce handling, and delivery best practices. Sample PHP code is given to illustrate techniques for sending emails and processing bounce addresses.
BizSense is an open source CRM and ERP software with the goals of being no-nonsense, having a modern web architecture, and integrating CRM and ERP features. The current version is 0.3 alpha with version 0.2.4 alpha planned for release soon. Features include customer relationship management, sales, marketing, customer service, finance, and reporting capabilities. Developers can contribute code, documentation, or help build the community. Contributions allow developers to improve skills and have experience to list on their resume.
XML is a standard for storing and transporting data. It allows data to be self-describing and easy to exchange between systems. XML documents must be well-formed, following rules like having matching tags and attributes in quotes. XML uses elements to represent data and attributes to represent metadata. Namespaces allow distinguishing between identically named elements from different domains. XML is processed by parsers like SAX, DOM, and StAX. XSLT uses XPath to transform XML documents into other formats like HTML.
The document discusses various topics related to web development including:
1. An overview of HTML, the language used to design web pages.
2. How to write basic HTML code using tags like <html>, <head>, <body>.
3. Common HTML elements for text formatting, links, images, and lists.
4. How attributes provide additional information for elements.
This document summarizes key aspects of XML including:
- XML is a text-based format for describing data structures that is both human and machine readable.
- XML became a W3C standard in 1998 and is commonly used for exchanging data between disparate systems.
- Java can be used to generate, access, format, parse, validate, and transform XML data.
- XML documents have a root element containing other nested elements and attributes to describe hierarchical data.
- Well-formed XML documents follow syntax rules for proper nesting of start/end tags and quotes around attribute values.
- XML parsers like SAX and DOM are used to read XML documents sequentially or build a navigable tree structure in memory
This document discusses how XML can be integrated into business applications. It provides examples of using XML to store and transfer data between different platforms and applications. It also discusses techniques for generating XML from databases and components using ADO and custom XML generators in VB.
This document discusses how XML can be integrated into business applications. It provides examples of using XML to store and transfer data between different platforms and applications. It also discusses techniques for generating XML from databases and components using ADO and custom XML generators in VB.
This document discusses how XML can be integrated into business applications. It provides examples of using XML to store and transfer data between different platforms and applications. It also discusses techniques for generating XML from databases and components using ADO and custom XML generators in VB.
This document discusses XML validation using an XML schema (XSD) file. It provides an example of using an XmlReader with validation enabled to validate an XML file against an XSD schema. The example loads an XML file, validates it using a schema at a given URI, and handles any validation errors, displaying status messages. It demonstrates how to automatically generate an XSD from an XML file in Visual Studio to define the XML structure.
The document discusses different XML parsers in Java including DOM, SAX, and StAX. DOM represents the XML document as an in-memory tree which allows flexible processing but uses more memory. SAX is event-driven and reads the XML sequentially using less memory. StAX is similar to SAX but simplified and "pull"-based where the developer manually navigates elements. The document also covers using JAXP for XML processing independence and the key classes involved in DOM and StAX parsing.
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeMarco Gralike
This document summarizes key concepts and capabilities of Oracle XML DB including:
1. The Protocol Server which handles XML storage and access via HTTP, FTP, and WebDAV. Its configuration involves files like listener.ora and xdbconfig.xml.
2. Various HTTP APIs for XML DB access like PL/SQL gateways, native database web services (NDWS), and the DBUri servlet for browsing database data.
3. URITypes for representing URIs that target database data (DBUriType), URLs outside the database (HTTPUriType), and resources in the XML DB repository (XDBUriType).
4. Combining XML DB with capabilities like BFILE to select and
This document provides an overview of XML documents and vocabularies. It discusses the structure of an XML document, including the document prolog section containing the XML declaration and document type declaration. It describes document elements as the building blocks of an XML document. It also explains XML declarations, namespaces, and DTDs (document type definitions). XML namespaces help avoid element name conflicts, and DTDs define rules to check the vocabulary and structure of XML documents. The document gives examples of internal and external DTDs.
This document summarizes Masahiro Nakagawa's presentation on Fluentd and Embulk. Fluentd is a data collector for unified logging that allows for streaming data transfer based on JSON. It is written in Ruby and uses plugins to collect, process, and output data. Embulk is a bulk loading tool that allows high performance parallel processing of data to load it into various databases and storage systems. Both tools use a pluggable architecture to provide flexibility in handling different data sources and targets.
Today’s web and mobile app localization industry relies on numerous standards, libraries and file formats to facilitate the exchange between developers and translators. While some formats are somewhat sophisticated, others lack even the most basic features, like pluralization and contextualization. And most can’t offer support for more advanced localization features, like language cases.
The most common localization formats include Gettext PO, PHP Arrays, Android XML, YAML, .Net RESX, iOS Strings and many others. A typical developer today works with many frameworks - for instance a Laravel backend app (PHP Arrays) with Ember front end (i18n JS) and iOS mobile app (Strings). Since all standards have distinct syntax, in many cases translations cannot be shared across applications.
Translation Markup Language (TML) aims to solve both these problems by introducing a powerful extensible cross-platform syntax that offers support for pluralization, language contextualization, language cases, reusable decorators and much more. TML libraries are available for all major web and mobile platforms. TML allows translators to do in-context translations - where they can translate right from within the apps. TML libraries also eliminate the need for developers to ever deal with the resource files, as all extractions and translation substitution is done realtime and the resource files are only used as a transport between the apps and the Translation Exchange platform.
Translation Exchange stores all translations in Universal Translation Memory (UTM), a graph database which stores all translations with their context, tone, rank and other attributes for accurate matching. This allows translations to be shared across all apps in the Translation Exchange Network. The translation memories of each app are extracted from the UTM graph and are managed by their individual localization teams. During this presentation we will look at some of the features of TML and how it can be used to quickly translate a Laravel application into any number of languages using in-context translation tools. We will also look at how the data is stored and shared across applications using UTM.
This is an introduction to web apps aimed at people without a tech background but who want to learn more about technology, e.g. people in business, sales or non-tech startup founders. It's an overview of how modern web applications are implemented, covering things like architecture, HTML, Javascript, server-side programming languages and a bit of history as well.
XML is everywhere. Computers, Mobiles, Bank Systems, Internet, TVs, Microwaves, all use XML as an Information Wrapping and Information Xchange System. We will tell you all the basics in a simplest possible way.
XML presentation discusses XML (Extensible Markup Language). It describes XML as a text-based markup language derived from SGML that is extensible and carries data without presenting it. The document provides examples of XML documents and elements like articles, authors, titles, and text. It also discusses XML syntax rules, namespaces to avoid element name conflicts, and the importance of XML for data transfer, configuration files, schemas/templates, and more. Querying XML data with XPath and XQuery is also introduced.
The document discusses microformats, which are a way to add semantics to web pages by using HTML and CSS classes to encode structured data about calendar events, contacts, reviews and other types of information. Microformats leverage existing web standards like HTML and CSS to make machine-readable data human-readable as well, by displaying it naturally on web pages. The paper evaluates how microformats are a successful approach to introducing semantics to web pages using pre-existing standards in a way that is compatible with both humans and machines.
Our CTO, Angel Gruev came up with quick Introduction to XML Technologies. (XML) is a markup language that defines a set of rules for encoding documents in a format which is both human-readable and machine-readable. It is defined by the W3C's XML 1.0 Specification and by several other related specifications, all of which are free open standards.
Esoft Metro Campus - Diploma in Web Engineering - (Module III) Coding HTML for Basic Web Designing
(Template - Virtusa Corporate)
Contents:
Introduction to HTML
HTML Versions
HTML Standards
Creating a Simple HTML Document
Document Type Declaration
Comments in HTML
HTML Attributes
Paragraphs
Line Break
Headings
Text Formatting
Font Formatting
Images
Hyperlinks
Page Body
Lists
Tables
Cell Merging in a Table
Table Attributes
Horizontal Rule
Iframes
HTML Blocks
Division
Span
Audio
Video
Youtube Videos
Forms and Input
Introduction to CSS
Advantages of Using CSS
CSS Syntax
CSS Comments
How to Insert CSS?
CSS Tag, ID and Class Selectors
Grouping and Nesting Selectors
CSS Backgrounds
CSS Text
CSS Fonts
CSS Links
CSS Lists
CSS Tables
CSS Box Model
CSS Dimension
CSS Display - Block and Inline
CSS Positioning
CSS Float
CSS Alignment
Navigation Menu in CSS
This document provides an overview and introduction to XML (eXtensible Markup Language). It discusses the basic rules of XML, parsing XML, XML namespaces, XML schemas, XSLT transformations, and examples of where XML is applied such as web design, web services, mobile web, and content authoring.
This document discusses PowerShell formatting and summarization techniques. It reviews default formatting, composite formatting strings, formatting with Format-Table and Format-List, and using formatting XML. It also demonstrates formatting strings, hash tables for formatting, and using a module called EasyOutput to simplify complex formatting tasks.
The document discusses best practices for sending bulk emails using PHP including using libraries like Zend_Mail and Swiftmailer, setting proper headers and authentication, managing opt-in subscriber lists, handling unsubscribes, and avoiding blacklisting. It also provides tips for identity and branding, list management, bounce handling, and delivery best practices. Sample PHP code is given to illustrate techniques for sending emails and processing bounce addresses.
BizSense is an open source CRM and ERP software with the goals of being no-nonsense, having a modern web architecture, and integrating CRM and ERP features. The current version is 0.3 alpha with version 0.2.4 alpha planned for release soon. Features include customer relationship management, sales, marketing, customer service, finance, and reporting capabilities. Developers can contribute code, documentation, or help build the community. Contributions allow developers to improve skills and have experience to list on their resume.
This document introduces Bare_Acl, an access control list component of the Bare PHP framework. It was created to simplify access control and works with common PHP autoloaders. The document demonstrates how to define privileges, roles, and rules to control access and use assertions to customize access checks. Contributions to Bare are welcome under an open source license.
This document summarizes a presentation about building RESTful applications using PHP. REST (Representational State Transfer) is a software architectural style that uses HTTP verbs to manipulate resources. The presentation covers the six constraints that define REST - client-server separation, statelessness, cacheability, uniform interface, layered system, and code on demand. It provides tips for implementing REST in PHP like using the header() function, determining the request method, and encoding/decoding JSON. Questions from the audience are answered at the end.
Mysql Naming Conventions Bangalore Mysql User Group Oct 11 09
XML For PHP Developers
1. XML For PHP Developers
by
Sudheer Satyanarayana
http://techchorus.net
Bangalore PHP User Group Meetup
30 October 2010
2. Agenda
Quick introduction to XML basics
Recipe 1 - parsing RSS feed
Recipe 2 - creating Atom feed
Recipe 3 - scraping information from websites using
XML
Question and answer
At the end of the session, you will be able to start using
XML with PHP.
3. XML Basics
XML document has a tree structure
XML documents can be validated using an XML schema
All major programming languages support reading and
writing XML documents
Hundreds of technologies are built on top of XML
XHTML is one of the XML markup languages
5. Which Parser To Use
simplexml - really simple XML documents
DOM - heavy lifting
SAX - large XML documents
XMLReader - large XML documents
Don't use:
string manipulation to create XML documents
regular expressions to parse XML documents
9. Retrieving weather info from Yahoo!
http://weather.yahooapis.com/forecastrss?w=2442047&u=c
w = location, WOEID
u = degrees units (Fahrenheit or Celsius)
http://weather.yahooapis.com/forecastrss?w=2295420&u=c
15. Atom - key takeaways
Disagreements in RSS community
Atom entry document
Atom feed document
Atom Publishing Protocol
Use Atom if you are a feed publisher
29. Building Xpath Expression
Find the table with the specified ID
//table[@id='ctl00_ContPlaceHolderMain_Alphabaticallist1_dg1']
Select all table rows after position 1
tr[position()>1]
Select table cells with position 2
td[position()=2]
Select anchor element
a
Select all children that are text nodes
child::text()
31. PHP Script
<?php
$html = file_get_contents('http://164.100.47.132/LssNew/Members/Alphabaticallist.aspx');
$doc = new DOMDocument();
$doc->loadHtml($html);
$domxpath = new DOMXPath($doc);
$xpath_expression = "//table[@id='ctl00_ContPlaceHolderMain_Alphabaticallist1_dg1']/tr[position()
>1]/td[position()=2]/a/child::text()";
$result = $domxpath->evaluate($xpath_expression);
echo "Total number of memembers of Lok Sabha " . $result->length;
foreach ($result as $r) {
echo "n" . $r->nodeValue;
}
32. QOTD
Retrieves quote of the day from Wikiquotes.org
Creates a feed
Also sends SMS to subscribers
http://qotd.techchorus.net
http://labs.google.co.in/smschannels/channel/WikiQuoteOfTheDay
33. Where To Go From Here?
Start using XML right away
Now you know how to parse and create feeds
Learn more XML technologies
Read the specifications
Scrape websites
Imagination is your limit
Build the next big thing since sliced bread!
34. Resources
Download files shown in this presentation -
http://techchorus.net/downloads/xml-for-php-developers/xml-for-php-developers.tar.gz
http://techchorus.net/downloads/xml-for-php-developers/xml-for-php-developers.zip
PHP Manual - http://in3.php.net/manual/en/refs.xml.php
Tech Chorus - http://techchorus.net
W3Schools - http://www.w3schools.com/xml/default.asp
Book - Pro PHP And XML Web Services by Robert
Richards. Review - http://techchorus.net/pro-php-xml-
and-web-services-book-review
More useful links - http://xml.farsquare.com/
36. Thank You
The slides will be available at SlideShare
http://www.slideshare.net/bngsudheer
My Twitter handle: @bngsudheer
Blog: http://techchorus.net
Business: http://binaryvibes.co.in
E-mail: sudheer @ above business URL
37. License
XML For PHP Developers by Sudheer Satyanarayana is
licensed under a Creative Commons Attribution-
NonCommercial-NoDerivs 2.5 India License . Based on a
work at techchorus.net . Permissions beyond the scope of
this license may be available at http://techchorus.net .