[Pharo-dev] XPath chapter...

J.F. Rick self at je77.com
Mon Oct 23 13:54:25 EDT 2017


Nice!

On Sun, Oct 22, 2017 at 11:53 PM Hernán Morales Durand <
hernan.morales at gmail.com> wrote:

> 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 <self at je77.com>:
> > 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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20171023/66e6300a/attachment-0002.html>


More information about the Pharo-dev mailing list