I don't know for Pharo development, but I used XPath in Pharo for
getting a textual description of gene ontology terms, for example:
#('GO:0005623' 'GO:0017071' 'GO:0030680') do: [ : goTerm |
| xPath xmlDoc quickGO |
quickGO := 'http://www.ebi.ac.uk/QuickGO-Old/GTerm?id={1}&format=oboxml'
format: { goTerm }.
xmlDoc := (XMLDOMParser on: (ZnEasy get: quickGO) contents) parseDocument.
xPath := XPath for: 'normalize-space(/obo/term/name/text())' in: xmlDoc.
Transcript show: goTerm; tab; show: xPath; cr ].
Here you've got similar code in Perl and Java so you can compare:
https://www.ebi.ac.uk/QuickGO-Old/clients/download-term.pl
https://www.ebi.ac.uk/QuickGO-Old/clients/DownloadTerm.java
Best regards,
Hernán
2017-10-21 14:04 GMT-03:00 J.F. Rick <[email protected]>:
> NICE! I was just using XPath for Selenium testing. It is really great for
> that application (commanding a browser like Firefox or Chrome to simulate
> user actions). What are the applications for XPath in Pharo? Unit testing of
> generating markup?
>
> Cheers,
>
> Jeff
>
> PS After spending significant time with other languages at work, I really
> have an appreciation of how wonderful Pharo is as a development environment.