-
Notifications
You must be signed in to change notification settings - Fork 67
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
Element nesting depth ignored #74
Comments
Hey, thanks for reporting. Would you mind writing a failing test so we can address this properly? Thanks. |
Sure, I'm on the road during the week, but I should be able to come up with a test this weekend. |
The specs for "parsing a tree without a collection class" and "with element deeper inside the xml structure" in Any ideas? |
Thanks for looking it up. Do you see any way of improving the things without introducing a breaking change? |
One idea is the class Foo
include SAXMachine
element :meta, class: Meta, within: '.' # only children of current element
elements :value, as: :values, within: './meta' # match within meta children of current element
elements :meta, as: :bar_metas, within: 'bar' # match meta inside any bar descendants
end |
I have the following case:
And the following mapping:
Now if I get
meta
of foo with id 1, I get the meta node of bar instead of the meta node of foo.How do I solve this?
Maybe it would be great to have a depth constraint, so I could define something like:
The text was updated successfully, but these errors were encountered: