vendredi 23 mars 2007

XPATH tips

XPath Expressions sympathiques :

avec comme exemple la structure xml suivante:









/bookstore/book[1] Selects the first book element that is the child of the bookstore element

/bookstore/book[last()] Selects the last book element that is the child of the bookstore element

/bookstore/book[last()-1] Selects the last but one book element that is the child of the bookstore element

/bookstore/book[position()<3] lang="'eng']">35.00] Selects all the book elements of the bookstore element that have a price element with a value greater than 35.00

/bookstore/book[price>35.00]/title Selects all the title elements of the book elements of the bookstore element that have a price element with a value greater than 35.00


Au suivant !

1 commentaire:

Alain Hélaïli a dit…
Ce commentaire a été supprimé par l'auteur.