Skip to content

problem with findall #175

@healyp

Description

@healyp

Perhaps I'm not using findall() correctly but I get the following behavior that, to me, is strange:

julia> c118=r; c118c1=elements(c118)[1]; println(c118c1)
<td>1911<br/><small> <sup class="reference" id="ref_anone"><a href="#endnote_anone">[a]</a></sup><br/><small><i><a href="/wiki/1911_All-Ireland_Senior_Hurling_Championship_Final" title="1911 All-Ireland Senior Hurling Championship Final">Details</a></i></small>
</small></td>
julia> links = findall("//i/a[@href]", c118c1)
137-element Vector{EzXML.Node}:
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003c66900>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003faf6d0>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003615020>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003906120>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003fe27c0>)
 ⋮
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003789b40>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003f66980>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003f82600>)

julia> 

All hrefs in the entire tree are picked up whereas I would only have expected the single href in the c118c1 sub-tree.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions