Enviar búsqueda
Cargar
Lumberjack XPath 101
•
0 recomendaciones
•
917 vistas
Thomas Weinert
Seguir
Vista de diapositivas
Denunciar
Compartir
Vista de diapositivas
Denunciar
Compartir
1 de 27
Descargar ahora
Descargar para leer sin conexión
Recomendados
Ruby meetup ROM
Ruby meetup ROM
Nikita Shilnikov
Database schema management in Ruby apps
Database schema management in Ruby apps
Vsevolod Romashov
RESTful web services
RESTful web services
Tudor Constantin
Webrtc mojo
Webrtc mojo
bpmedley
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011
Jacopo Romei
PHP and MySQL
PHP and MySQL
webhostingguy
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
Yusuke Wada
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
Cosimo Streppone
Recomendados
Ruby meetup ROM
Ruby meetup ROM
Nikita Shilnikov
Database schema management in Ruby apps
Database schema management in Ruby apps
Vsevolod Romashov
RESTful web services
RESTful web services
Tudor Constantin
Webrtc mojo
Webrtc mojo
bpmedley
Symfony CMF - PHP Conference Brazil 2011
Symfony CMF - PHP Conference Brazil 2011
Jacopo Romei
PHP and MySQL
PHP and MySQL
webhostingguy
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
Yusuke Wada
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
Cosimo Streppone
PHP7 Presentation
PHP7 Presentation
David Sanchez
Developing apps using Perl
Developing apps using Perl
Anatoly Sharifulin
Mojolicious, real-time web framework
Mojolicious, real-time web framework
taggg
Mojolicious on Steroids
Mojolicious on Steroids
Tudor Constantin
Mojolicious - A new hope
Mojolicious - A new hope
Marcus Ramberg
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Dotan Dimet
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Anatoly Sharifulin
Php
Php
samirlakhanistb
Extending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh Pollock
Caldera Labs
An Introduction to Symfony
An Introduction to Symfony
xopn
Using the new WordPress REST API
Using the new WordPress REST API
Caldera Labs
A new way to develop with WordPress!
A new way to develop with WordPress!
David Sanchez
Php basics
Php basics
Egerton University
Php
Php
khushbulakhani1
Thymeleaf Introduction
Thymeleaf Introduction
Anthony Chen
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
eugenio pombi
Introducere in web
Introducere in web
Alex Eftimie
Asynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
deepfountainconsulting
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
webhostingguy
Php classes in mumbai
Php classes in mumbai
aadi Surve
Optimizing Your Frontend Performance
Optimizing Your Frontend Performance
Thomas Weinert
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
Thomas Weinert
Más contenido relacionado
La actualidad más candente
PHP7 Presentation
PHP7 Presentation
David Sanchez
Developing apps using Perl
Developing apps using Perl
Anatoly Sharifulin
Mojolicious, real-time web framework
Mojolicious, real-time web framework
taggg
Mojolicious on Steroids
Mojolicious on Steroids
Tudor Constantin
Mojolicious - A new hope
Mojolicious - A new hope
Marcus Ramberg
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Dotan Dimet
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Anatoly Sharifulin
Php
Php
samirlakhanistb
Extending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh Pollock
Caldera Labs
An Introduction to Symfony
An Introduction to Symfony
xopn
Using the new WordPress REST API
Using the new WordPress REST API
Caldera Labs
A new way to develop with WordPress!
A new way to develop with WordPress!
David Sanchez
Php basics
Php basics
Egerton University
Php
Php
khushbulakhani1
Thymeleaf Introduction
Thymeleaf Introduction
Anthony Chen
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
eugenio pombi
Introducere in web
Introducere in web
Alex Eftimie
Asynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
deepfountainconsulting
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
webhostingguy
Php classes in mumbai
Php classes in mumbai
aadi Surve
La actualidad más candente
(20)
PHP7 Presentation
PHP7 Presentation
Developing apps using Perl
Developing apps using Perl
Mojolicious, real-time web framework
Mojolicious, real-time web framework
Mojolicious on Steroids
Mojolicious on Steroids
Mojolicious - A new hope
Mojolicious - A new hope
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Mojolicious. Веб в коробке!
Mojolicious. Веб в коробке!
Php
Php
Extending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh Pollock
An Introduction to Symfony
An Introduction to Symfony
Using the new WordPress REST API
Using the new WordPress REST API
A new way to develop with WordPress!
A new way to develop with WordPress!
Php basics
Php basics
Php
Php
Thymeleaf Introduction
Thymeleaf Introduction
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
Introducere in web
Introducere in web
Asynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
Php classes in mumbai
Php classes in mumbai
Destacado
Optimizing Your Frontend Performance
Optimizing Your Frontend Performance
Thomas Weinert
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
Thomas Weinert
Deliver Files With PHP
Deliver Files With PHP
Thomas Weinert
Controlling Arduino With PHP
Controlling Arduino With PHP
Thomas Weinert
Asynchronous I/O in PHP
Asynchronous I/O in PHP
Thomas Weinert
PHPUG CGN: Controlling Arduino With PHP
PHPUG CGN: Controlling Arduino With PHP
Thomas Weinert
XPath Introduction
XPath Introduction
Stuart Myles
Destacado
(7)
Optimizing Your Frontend Performance
Optimizing Your Frontend Performance
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
Deliver Files With PHP
Deliver Files With PHP
Controlling Arduino With PHP
Controlling Arduino With PHP
Asynchronous I/O in PHP
Asynchronous I/O in PHP
PHPUG CGN: Controlling Arduino With PHP
PHPUG CGN: Controlling Arduino With PHP
XPath Introduction
XPath Introduction
Similar a Lumberjack XPath 101
Hacking with hhvm
Hacking with hhvm
Elizabeth Smith
PHP5.5 is Here
PHP5.5 is Here
julien pauli
Network Automation: Ansible 102
Network Automation: Ansible 102
APNIC
Living With Legacy Code
Living With Legacy Code
Rowan Merewood
Intro to JavaScript
Intro to JavaScript
Jussi Pohjolainen
Php 5.6 From the Inside Out
Php 5.6 From the Inside Out
Ferenc Kovács
Building Advanced XSS Vectors
Building Advanced XSS Vectors
Rodolfo Assis (Brute)
Meta Object Protocols
Meta Object Protocols
Pierre de Lacaze
GettingStartedWithPHP
GettingStartedWithPHP
Nat Weerawan
Mojolicious
Mojolicious
Marcos Rebelo
XPath for web scraping
XPath for web scraping
Scrapinghub
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010
Bastian Feder
Advanced symfony Techniques
Advanced symfony Techniques
Kris Wallsmith
PHP Performance Trivia
PHP Performance Trivia
Nikita Popov
PSR-7 and PSR-15, why can't you ignore them
PSR-7 and PSR-15, why can't you ignore them
Sérgio Rafael Siqueira
Ant vs Phing
Ant vs Phing
Manuel Baldassarri
Quick tour of PHP from inside
Quick tour of PHP from inside
julien pauli
Speed up your developments with Symfony2
Speed up your developments with Symfony2
Hugo Hamon
GHCソースコード読みのススメ
GHCソースコード読みのススメ
Kiwamu Okabe
PHP Development Tools
PHP Development Tools
Antony Abramchenko
Similar a Lumberjack XPath 101
(20)
Hacking with hhvm
Hacking with hhvm
PHP5.5 is Here
PHP5.5 is Here
Network Automation: Ansible 102
Network Automation: Ansible 102
Living With Legacy Code
Living With Legacy Code
Intro to JavaScript
Intro to JavaScript
Php 5.6 From the Inside Out
Php 5.6 From the Inside Out
Building Advanced XSS Vectors
Building Advanced XSS Vectors
Meta Object Protocols
Meta Object Protocols
GettingStartedWithPHP
GettingStartedWithPHP
Mojolicious
Mojolicious
XPath for web scraping
XPath for web scraping
The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010
Advanced symfony Techniques
Advanced symfony Techniques
PHP Performance Trivia
PHP Performance Trivia
PSR-7 and PSR-15, why can't you ignore them
PSR-7 and PSR-15, why can't you ignore them
Ant vs Phing
Ant vs Phing
Quick tour of PHP from inside
Quick tour of PHP from inside
Speed up your developments with Symfony2
Speed up your developments with Symfony2
GHCソースコード読みのススメ
GHCソースコード読みのススメ
PHP Development Tools
PHP Development Tools
Más de Thomas Weinert
FluentDom
FluentDom
Thomas Weinert
Optimizing Your Frontend Performance
Optimizing Your Frontend Performance
Thomas Weinert
Experiences With Pre Commit Hooks
Experiences With Pre Commit Hooks
Thomas Weinert
The Lumber Mill - XSLT For Your Templates
The Lumber Mill - XSLT For Your Templates
Thomas Weinert
The Lumber Mill Xslt For Your Templates
The Lumber Mill Xslt For Your Templates
Thomas Weinert
SVN Hook
SVN Hook
Thomas Weinert
PHP 5.3/6
PHP 5.3/6
Thomas Weinert
Optimizing Your Frontend Performance
Optimizing Your Frontend Performance
Thomas Weinert
Más de Thomas Weinert
(8)
FluentDom
FluentDom
Optimizing Your Frontend Performance
Optimizing Your Frontend Performance
Experiences With Pre Commit Hooks
Experiences With Pre Commit Hooks
The Lumber Mill - XSLT For Your Templates
The Lumber Mill - XSLT For Your Templates
The Lumber Mill Xslt For Your Templates
The Lumber Mill Xslt For Your Templates
SVN Hook
SVN Hook
PHP 5.3/6
PHP 5.3/6
Optimizing Your Frontend Performance
Optimizing Your Frontend Performance
Lumberjack XPath 101
1.
#PBCAT
The Lumberjack - Xpath 101 Thomas Weinert
2.
About Me ●
Application Developer ● PHP ● JavaScript ● XSL ● papaya Software GmbH ● papaya CMS ● Technical Director ● FluentDOM
3.
Questions!
Please ask any time!
4.
Xpath 1 ●
XML Path Language ● W3C Recommendation 16 November 1999 ● Used by ● XSLT 1 ● XPointer
5.
Xpath 2 ●
W3C Recommendation 23 January 2007 ● Superset of Xpath 1 ● More data types
6.
DOM ●
Document Object Modell ● Standard extension: ext/dom ● LibXml2 ● Xpath 1
7.
DOMXpath ●
Create after loading the document! ● evaluate()/query() <?php $str = '<sample><element/></sample>'; $dom = new DOMDocument(); $dom->loadXML($str); $xpath = new DOMXPath($dom); var_dump($xpath->evaluate('//element')); var_dump($xpath->evaluate('//noelement')); var_dump($xpath->evaluate('//noelement/@attr')); ?> object(DOMNodeList)[5]
8.
SimpleXML ●
Always return SimpleXML <?php $str = '<sample><element/></sample>'; $xml = simplexml_load_string($str); var_dump($xml->xpath('//element')); var_dump($xml->xpath('//noelement')); var_dump($xml->xpath('//noelement/@attr')); ?> array array boolean false 0 => empty object(SimpleXMLElement)[2]
9.
XSL ●
Libxslt ● based on Libxml2 ● ext/xsl ● ext/xslcache
10.
Syntax
/element/child[@attr] Absolute Path Step 1 Predicate Separator Step 2
11.
Nodes ●
node() ● * or qualified-name ● text() ● comment() ● processing-instruction()
12.
Axes ●
axis::... ● Full syntax ● Short Syntax ● Default Axis
13.
child <barcamps> <barcamp
title="PHP Unconference Hamburg" id="phpuchh"> <link href="http://www.php-unconference.de/" /> </barcamp> <barcamp title="PHP Barcamp Salzburg" id="phpbcat"> <link href="http://www.phpbarcamp.at/cms/" /> <speakers-featured> <speaker>Bastian Feder</speaker> </speakers-featured> <speakers> <speaker>Thomas Weinert</speaker> </speakers> </barcamp> <barcamp title="PHP Unconference Europe" id="phpuceu"> <link href="http://www.phpuceu.org/"> </barcamp> </barcamps>
14.
descendant <barcamps> <barcamp
title="PHP Unconference Hamburg" id="phpuchh"> <link href="http://www.php-unconference.de/" /> </barcamp> <barcamp title="PHP Barcamp Salzburg" id="phpbcat"> <link href="http://www.phpbarcamp.at/cms/" /> <speakers-featured> <speaker>Bastian Feder</speaker> </speakers-featured> <speakers> <speaker>Thomas Weinert</speaker> </speakers> </barcamp> <barcamp title="PHP Unconference Europe" id="phpuceu"> <link href="http://www.phpuceu.org/"> </barcamp> </barcamps>
15.
parent <barcamps> <barcamp
title="PHP Unconference Hamburg" id="phpuchh"> <link href="http://www.php-unconference.de/" /> </barcamp> <barcamp title="PHP Barcamp Salzburg" id="phpbcat"> <link href="http://www.phpbarcamp.at/cms/" /> <speakers-featured> <speaker>Bastian Feder</speaker> </speakers-featured> <speakers> <speaker>Thomas Weinert</speaker> </speakers> </barcamp> <barcamp title="PHP Unconference Europe" id="phpuceu"> <link href="http://www.phpuceu.org/"> </barcamp> </barcamps>
16.
following-sibling <barcamps> <barcamp
title="PHP Unconference Hamburg" id="phpuchh"> <link href="http://www.php-unconference.de/" /> </barcamp> <barcamp title="PHP Barcamp Salzburg" id="phpbcat"> <link href="http://www.phpbarcamp.at/cms/" /> <speakers-featured> <speaker>Bastian Feder</speaker> </speakers-featured> <speakers> <speaker>Thomas Weinert</speaker> </speakers> </barcamp> <barcamp title="PHP Unconference Europe" id="phpuceu"> <link href="http://www.phpuceu.org/"> </barcamp> </barcamps>
17.
More Axes ●
ancestor ● attribute ● ancestor-or-self ● namespaces ● descendant-or-self ● following ● preceding ● preceding-sibling ● self
18.
Short Syntax ●
self::node()/ descendant-or-self::node()/ child::para ● .//para Axis Short child self . parent .. attribute @ descendant-or-self /
19.
Cast Functions ●
string() ● number() ● boolean() echo $xpath->evaluate('string(/html/head/title)');
20.
Node Functions ●
count() ● name() ● last() ● local-name() ● position() ● namespace-uri() $list = $xpath->evaluate( '//*[local-name() = 'li' and position() = last()]' );
21.
String Functions ●
concat() ● normalize-string() ● starts-with() ● translate() ● contains() ● substring-before() ● substring-after() ● substring() ● string-length()
22.
Match A Class ●
normalize-string() ● concat() ● contains()
23.
Namespaces ●
URN ● Prefix ● Default Namespace ● Own Prefixes ● Attributes
24.
Bug #49490 ●
Namespace prefix conflict $dom = new DOMDocument(); $dom->loadXML( '<foobar><a:foo xmlns:a="urn:a">'. '<b:bar xmlns:b="urn:b"/></a:foo>'. '</foobar>' ); $xpath = new DOMXPath($dom); $context = $dom->documentElement->firstChild; $xpath->registerNamespace('a', 'urn:b'); var_dump( $xpath->evaluate('descendant-or-self::a:*', $context) ->item(0)->tagName );
25.
Tools ●
Firebug ● Firefox AddOns
26.
CSS Selectors ●
JavaScript libraries ● element nodes ● * ● no axes ● descendant-or-self::* ● can ignore namespaces ● descendant-or-self::*[local-name() = '...']
27.
Thanks ●
Web: ● http://www.papaya-cms.com/ ● http://www.a-basketful-of-papayas.net/ ● Twitter ● @ThomasWeinert ● Joind.in ● http://joind.in/1621
Descargar ahora