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

Be Python 3.x-compatible and respect xpath index access methods #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nicklasb
Copy link

unicode is undefined in python 3, as everything is unicode there. There are no defined unit tests, so I am not nicely able to test for 2.x-compatibility.

@nicklasb
Copy link
Author

I added another commit, this because the current scheme of having the index in the tag name for lists breaks how xpath works, which is a quite serious bug.

The correct xpath way of listing the children of a tag is to do tag/child, and you get all the child nodes that are called child. To access a specific index, use tag/child[position()=1 to get the first child instead.

Therefore, there is no point in having the indices in the tag names, rather it makes it impossible to use xpath as it is. Therefore I propose to call array items "item" instead of the current scheme.

@nicklasb nicklasb changed the title Be Python 3.x-compatible Be Python 3.x-compatible and respect xpath index access methods Mar 21, 2016
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

Successfully merging this pull request may close these issues.

1 participant