j'c'westlakestaffs'ac'uk - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

j'c'westlakestaffs'ac'uk

Description:

Useful tool for testing out XPath. Once unzipped you can fire up a screen as on the next ... XML instance will be the XML document you wish to use i.e. a. ... – PowerPoint PPT presentation

Number of Views:72
Avg rating:3.0/5.0
Slides: 7
Provided by: jonathan76
Category:

less

Transcript and Presenter's Notes

Title: j'c'westlakestaffs'ac'uk


1
Expression Builder
  • Useful tool for testing out XPath
  • Once unzipped you can fire up a screen as on the
    next slide
  • XML instance will be the XML document you wish
    to use i.e. a .xml file in this case
    contacts.xml
  • In the node-set expression box you can type the
    XPath expression you wish to use

2
(No Transcript)
3
Selecting Nodes
  • XPath uses path expressions to select nodes in an
    XML document. The node is selected by following a
    path or steps. The most useful path expressions
    are listed below
  • Nodename - Selects all child nodes of the node
  • / Selects from the root node
  • // Selects nodes in the document from the current
    node that match the selection no matter where
    they are
  • . Selects the current node
  • .. Selects the parent of the current node
  • _at_ Selects attributes

4
XPath expresssions examples
  • contactlist - Selects the root element
  • /contactlist does the same thing
  • /contactlist/contact - Selects all contact
    elements that are children of contactlist
  • //contact - Selects all contact elements no
    matter where they are in the document
  • contactlist//contact - Selects all contact
    elements that are descendant of the contactlist
    element, no matter where they are under the
    contactlist element
  • //_at_owner - Selects all attributes that are named
    owner

5
examples
  • //contactlist/_at_ Selects all title elements
    which have any attribute
  • // selects all elements in the document
  • /contactlist/contact1 should work! And find
    the 1st instance of the element
  • Doesnt work at present in the expression builder

6
For more about XPath
  • Visit w3schools.com
Write a Comment
User Comments (0)
About PowerShow.com