Am 04.12.2014 um 21:25 schrieb Sascha Ziemann: > It seems to me that the use of //* duplicates the inner 'a' node:
That's not what it does. I'm not completely sure that XPath does require this behavior, but I tend to believe this is the right thing to do. "//" is supposed to yield all descendant nodes, in this example the second "span" (sure including this "span"'s descendant "a") and the "a" node itself. However the out-of-order result of "text()" nodes is odd. I guess that one is wrong. > > (begin > (newline) > (pp ((sxpath "//h1[@class='header']//*") > (with-input-from-request > "http://www.imdb.com/title/tt0497465/" > #f html->sxml)))) > > prints > > ((span (@ (class "itemprop") (itemprop "name")) "Vicky Cristina Barcelona") > (span (@ (class "nobr")) > "(" > (a (@ (href "/year/2008/?ref_=tt_ov_inf")) "2008") > ")") > (a (@ (href "/year/2008/?ref_=tt_ov_inf")) "2008")) > > Although there is only one hyper-ref in the HTML code. > > > _______________________________________________ > Chicken-users mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/chicken-users > _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
