2009 08 22 Froscon Xpath

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Group & 1 Event

    2009 08 22 Froscon Xpath - Presentation Transcript

    1. Xpath with PHP Arne Blankerts at FrOSCon 2009 August 22nd 2009 Copyright © 2009 thePHP.cc, Germany
    2. XPath?  An XML Query Language  Often considered the SQL for XML  XML seen as a directory structure  Allows for easy and flexible finding of nodes  Supports very complex queries with yet an easy to read syntax  Version 2 just recently standardized  LibXML 2 so far only supports version 1  Bug Rob Richards to add version 2 ;-P
    3. XPath?  XSL(T)  XML Stylesheet Language  Used for (T)ransformations of XML dialects  Available through libXSL & ext/xsl in php  DOM Standard  DOMXPath Object within PHP (ext/dom)  Native API in Gecko based browers  Selenium Testing  Specify elements for the tests
    4. XPath and DOM  Two ways to query  A query returns a Nodelist  Nodelists contain only references to DomNodes  A query can also return a direct value  Namespace aware  Must use prefixes – all the time  Do not mix with DOM Level 1 Methods
    5. XPath and PHP  DOM  DOMXPath Object  Used in conjunction with DOMDocument  Nodelists contain references to DOMNodes  SimpleXML  Direct query possible, no seperate Objects  Array of references to SimpleXML-Objects
    6. XPath – The basic syntax  Level Seperator: /  Every Level: //  Wildcard: *  Attribute: @  Wildcard-Attribute: @*  Filter or Requirement: [ ... ]
    7. XPath functions – a selection  starts-with()  contains()  position()  last()  string-length()  substring()  not()  ...
    8. XPath and XSL(T)  Some additional functions  document()  format-number()  current()  ...
    9. XPath, XSL and PHP  PHP Callbacks possible  php:function(....)  EXSLT-Functions  Date & Time handling  Custom functions  ...
    10. XPath Samples  //node  /root/element  /root/element[1]  Xpath starts counting with 1 (except for IE 6)  @id  /root//node/@name  /root/element[@name = 'php']/@*  ./some/*[@class='tek']/@id  //php:node/demo:element[test]
    11. XPath in the real world. Aka let's play Live Demo ;-)
    12. Selenium  GUI Testing framework  For webbased content and applications  Selenium IDE  Firefox Extension for easy test writing  Selenium RC (remote control)  Server process to automate testing  Controls Gecko, Webkit and even IE  Supported by PHPUnit!
    13. Selenium IDE Live Demo ;-)
    14. Q & A Copyright © 2009 thePHP.cc, Germany
    15. Thank you. Copyright © 2009 thePHP.cc, Germany

    + Arne BlankertsArne Blankerts, 3 months ago

    custom

    440 views, 0 favs, 1 embeds more stats

    "XPath with PHP" Talk at FrOSCon 2009, St. Augustin more

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 440
      • 395 on SlideShare
      • 45 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 7
    Most viewed embeds
    • 45 views on http://www.phphatesme.com

    more

    All embeds
    • 45 views on http://www.phphatesme.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events