Skip to content

XPath last() function fails #13

@lmorillas

Description

@lmorillas

XPath last() function doesn't return the last item of a nodeset. When last() function is used in xpath expressions, the result is allways an empty nodeset.

See the test of the test suite:

xml file tests/xslt/borrowed/dh_20000530_01.xml

<nodes>
  <node>a</node>
  <node>b</node>
  <node>c</node>
</nodes>

amara code

 >>> doc = amara.parse('dh_20000530_01.xml')
 >>> doc.xml_select(u'/nodes/node[last()]')
 nodeset()
 >>> doc.xml_select(u'/nodes/node')
 nodeset([<amara.tree.element at 0x236c2d0: name u'node', 0 namespaces, 0 attributes, 1 children>, 
                <amara.tree.element at  0x236c4d0: name u'node', 0 namespaces, 0 attributes, 1 children>, 
                <amara.tree.element at 0x236c9d0: name u'node', 0 namespaces, 0 attributes, 1 children>])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions