2009 05 20 Phptek 2009 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

    2 Favorites, 1 Group & 1 Event

    2009 05 20 Phptek 2009 Xpath - Presentation Transcript

    1. Understanding XPath Arne Blankerts at php|tek 2009, Chicago, USA May 20 th 2009
    2. Who we are Premium PHP Consulting & Training. Worldwide. Arne Blankerts Sebastian Bergmann Stefan Priebsch
    3. 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
    4. 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
    5. 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
    6. 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
    7. XPath – The basic syntax
      • Level Seperator: /
      • Every Level: //
      • Wildcard: *
      • Attribute: @
        • Wildcard-Attribute: @*
      • Filter or Requirement: [ ... ]
    8. XPath functions – a selection
      • starts-with()
      • contains()
      • position()
      • last()
      • string-length()
      • substring()
      • not()
      • ...
    9. XPath and XSL(T)
      • Some additional functions
        • document()
        • format-number()
        • current()
        • ...
    10. XPath, XSL and PHP
      • PHP Callbacks possible
        • php:function(....)
      • EXSLT-Functions
        • Date & Time handling
        • Custom functions
        • ...
    11. XPath Samples
      • //node
      • /root/element
      • /root/element[1]
      • @id
      • /root//node/@name
      • /root/element[@name = 'php']/@*.
      • ./some/*[@class='tek']/@id
    12. XPath in the real world. Aka let's play Live Demo ;-)
    13. 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!
    14. Selenium IDE Live Demo ;-)
    15. Q & A
    16. Thank you.

    + Arne BlankertsArne Blankerts, 6 months ago

    custom

    695 views, 2 favs, 0 embeds more stats

    Slides from the "Understanding XPath" Session at ph more

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 695
      • 695 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 35
    Most viewed embeds

    more

    All embeds

    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