-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
I have the following case:
<root>
<foo id="1">
<bar>
<meta>
<value id="a"/>
<value id="b"/>
</meta>
</bar>
<meta>
<value id="x"/>
<value id="y"/>
</meta>
</foo>
<foo id="2">
<meta>
<value id="z"/>
</meta>
</foo>
</root>And the following mapping:
class Root
include SAXMachine
elements :foo, as: :children, class: Foo
end
class Meta
include SAXMachine
elements :values, as: :values, class: String
end
class Foo
include SAXMachine
element :meta, class: Meta
endNow if I get metaof 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:
class Foo
include SAXMachine
element :meta, class: Meta, depth: 1
element :other, class: Other, depth: ->(depth) { depth > 2 && depth < 5 }
endMetadata
Metadata
Assignees
Labels
No labels