Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Support custom xpath for happymapper items? #21
Thanks for happymapper! I put it to work parsing the Intrade API, but ran into an issue with an element named "msg" which included a member element that was also named "msg", but of a different type than the outer element. This pull request includes a solution to that issue, allowing users to override the default xpath-generation logic with an xpath literal. The problem with the Intrade API can be resolved by specifying option :xpath => './msg', which only includes direct children. I included fixtures with a sanitized example and specs which exercise the new option. I hope you find this useful.