Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XPath last() function fails #13

Open
lmorillas opened this issue Aug 12, 2012 · 0 comments
Open

XPath last() function fails #13

lmorillas opened this issue Aug 12, 2012 · 0 comments

Comments

@lmorillas
Copy link
Contributor

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>])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant